[git commit master 1/1] ldso: Do not adjust dynamic section entries unnecessarily

Carmelo Amoroso carmelo.amoroso at st.com
Wed Sep 15 11:08:50 UTC 2010


commit: http://git.uclibc.org/uClibc/commit/?id=33cb7f0b4ae63f56523a20bd13e897c0cb97d73d
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/master

Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono at st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
---
 ldso/include/dl-elf.h |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h
index 9c2888f..cbb2100 100644
--- a/ldso/include/dl-elf.h
+++ b/ldso/include/dl-elf.h
@@ -162,15 +162,18 @@ unsigned int __dl_parse_dynamic_info(ElfW(Dyn) *dpnt, unsigned long dynamic_info
 		if (dynamic_info[tag]) \
 			dynamic_info[tag] = (unsigned long) DL_RELOC_ADDR(load_off, dynamic_info[tag]); \
 	} while (0)
-	ADJUST_DYN_INFO(DT_HASH, load_off);
-	ADJUST_DYN_INFO(DT_PLTGOT, load_off);
-	ADJUST_DYN_INFO(DT_STRTAB, load_off);
-	ADJUST_DYN_INFO(DT_SYMTAB, load_off);
-	ADJUST_DYN_INFO(DT_RELOC_TABLE_ADDR, load_off);
-	ADJUST_DYN_INFO(DT_JMPREL, load_off);
+	/* Don't adjust .dynamic unnecessarily.  */
+	if (load_off != 0) {
+		ADJUST_DYN_INFO(DT_HASH, load_off);
+		ADJUST_DYN_INFO(DT_PLTGOT, load_off);
+		ADJUST_DYN_INFO(DT_STRTAB, load_off);
+		ADJUST_DYN_INFO(DT_SYMTAB, load_off);
+		ADJUST_DYN_INFO(DT_RELOC_TABLE_ADDR, load_off);
+		ADJUST_DYN_INFO(DT_JMPREL, load_off);
 #ifdef __LDSO_GNU_HASH_SUPPORT__
-	ADJUST_DYN_INFO(DT_GNU_HASH_IDX, load_off);
+		ADJUST_DYN_INFO(DT_GNU_HASH_IDX, load_off);
 #endif
+	}
 #undef ADJUST_DYN_INFO
 	return rtld_flags;
 }
-- 
1.7.1



More information about the uClibc-cvs mailing list