b4f9ce681c24ba67d7c9efd234eedf0541e70771
[openwrt/staging/yousong.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 @@ extern int _dl_linux_resolve(void);
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 @@ -166,7 +170,7 @@ unsigned int __dl_parse_dynamic_info(Elf
15 we'd have to walk all the loadsegs to find out if it was
16 actually unnecessary, so skip this optimization. */
17 #ifndef __FDPIC__
18 - if (load_off != 0)
19 + if (DL_LOADADDR_ISSET(load_off))
20 #endif
21 {
22 ADJUST_DYN_INFO(DT_HASH, load_off);
23 --- a/ldso/ldso/ubicom32/dl-sysdep.h
24 +++ b/ldso/ldso/ubicom32/dl-sysdep.h
25 @@ -101,6 +101,7 @@ do { \
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))