diff options
author | Filippo Arcidiacono <filippo.arcidiacono@st.com> | 2010-07-27 17:45:26 +0200 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2010-09-15 13:08:50 +0200 |
commit | 33cb7f0b4ae63f56523a20bd13e897c0cb97d73d (patch) | |
tree | 567d76823f4fb242a6b20974b1aa394b2bb15aa8 /ldso/include | |
parent | 447c70a5dc04e85f96c2ae477ce851fdfdd8c719 (diff) |
ldso: Do not adjust dynamic section entries unnecessarily
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'ldso/include')
-rw-r--r-- | 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 9c2888f5b..cbb2100b1 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; } |