scummvm random work
[patches.git] / bfin-uclibc-l1-fail-msg.patch
CommitLineData
5e993f12 1Index: ldso/ldso/bfin/dl-inlines.h
2===================================================================
3--- ldso/ldso/bfin/dl-inlines.h (revision 1816)
4+++ ldso/ldso/bfin/dl-inlines.h (revision 1817)
5@@ -541,7 +541,7 @@
6 _dl_dma_memcpy (l1addr, status + (ppnt->p_vaddr & ADDR_ALIGN), ppnt->p_filesz);
7 _dl_munmap (status, size);
8 if (l1addr == NULL)
9- return NULL;
10+ _dl_dprintf(2, "%s:%i: L1 allocation failed\n", _dl_progname, __LINE__);
11 return l1addr;
12 }
13
14@@ -557,12 +557,16 @@
15 l1addr = (char *) _dl_sram_alloc (ppnt->p_memsz, L1_DATA_B_SRAM);
16 else
17 l1addr = (char *) _dl_sram_alloc (ppnt->p_memsz, L1_DATA_SRAM);
18- if (l1addr == NULL
19- || (_DL_PREAD (infile, l1addr, ppnt->p_filesz, ppnt->p_offset)
20- != ppnt->p_filesz))
21- return NULL;
22- if (ppnt->p_filesz < ppnt->p_memsz)
23- _dl_memset (l1addr + ppnt->p_filesz, 0, ppnt->p_memsz - ppnt->p_filesz);
24+ if (l1addr == NULL) {
25+ _dl_dprintf(2, "%s:%i: L1 allocation failed\n", _dl_progname, __LINE__);
26+ } else {
27+ if (_DL_PREAD (infile, l1addr, ppnt->p_filesz, ppnt->p_offset) != ppnt->p_filesz) {
28+ _dl_sram_free (l1addr);
29+ return NULL;
30+ }
31+ if (ppnt->p_filesz < ppnt->p_memsz)
32+ _dl_memset (l1addr + ppnt->p_filesz, 0, ppnt->p_memsz - ppnt->p_filesz);
33+ }
34 return l1addr;
35 }
36