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