toolchain/uClibc: push an upstream fix
[openwrt/staging/chunkeey.git] / toolchain / uClibc / patches-0.9.32 / 601-ubicom32_uClibc_fixes.patch
1 --- a/ldso/include/dl-elf.h
2 +++ b/ldso/include/dl-elf.h
3 @@ -42,6 +42,10 @@
4 extern int _dl_fixup(struct dyn_elf *rpnt, int flag);
5 extern void _dl_protect_relro (struct elf_resolve *l);
6
7 +#ifndef DL_LOADADDR_ISSET(_loadaddr)
8 +#define DL_LOADADDR_ISSET(_loadaddr) ((_loadaddr) != 0)
9 +#endif
10 +
11 /*
12 * Bitsize related settings for things ElfW()
13 * does not handle already
14 @@ -163,7 +167,7 @@
15 dynamic_info[tag] = (unsigned long) DL_RELOC_ADDR(load_off, dynamic_info[tag]); \
16 } while (0)
17 /* Don't adjust .dynamic unnecessarily. */
18 - if (load_off != 0) {
19 + if (DL_LOADADDR_ISSET(load_off)) {
20 ADJUST_DYN_INFO(DT_HASH, load_off);
21 ADJUST_DYN_INFO(DT_PLTGOT, load_off);
22 ADJUST_DYN_INFO(DT_STRTAB, load_off);
23 --- a/ldso/ldso/ubicom32/dl-sysdep.h
24 +++ b/ldso/ldso/ubicom32/dl-sysdep.h
25 @@ -101,6 +101,7 @@
26 } while (0)
27
28 #define DL_LOADADDR_TYPE struct elf32_fdpic_loadaddr
29 +#define DL_LOADADDR_ISSET(_loadaddr) ((_loadaddr).map != NULL)
30
31 #define DL_RELOC_ADDR(LOADADDR, ADDR) \
32 ((ElfW(Addr))__reloc_pointer ((void*)(ADDR), (LOADADDR).map))