summaryrefslogtreecommitdiff
path: root/ldso/ldso/dl-elf.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-01-29 11:42:46 +0000
committerEric Andersen <andersen@codepoet.org>2004-01-29 11:42:46 +0000
commit8391a5231556a37c6f7eef871c3e310e91623b00 (patch)
treec9db585d48ae03c1f37146720780f0f3e5c1cd31 /ldso/ldso/dl-elf.c
parent8e5b520d884b4793f69415b303d6f4447a7521c2 (diff)
Scrub up use of ELF_USES_RELOCA and eliminte some unsightly ifdefs
Diffstat (limited to 'ldso/ldso/dl-elf.c')
-rw-r--r--ldso/ldso/dl-elf.c68
1 files changed, 26 insertions, 42 deletions
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index fb7eacc12..4b6d75d7a 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -874,74 +874,58 @@ int _dl_fixup(struct dyn_elf *rpnt, int flag)
tpnt = rpnt->dyn;
#if defined (__SUPPORT_LD_DEBUG__)
- if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);
-#endif
-
- if (tpnt->dynamic_info[DT_REL]) {
-#ifdef ELF_USES_RELOCA
-#if defined (__SUPPORT_LD_DEBUG__)
- if(_dl_debug) _dl_dprintf(2, "%s: can't handle REL relocation records\n", _dl_progname);
-#endif
- goof++;
- return goof;
-#else
- if (tpnt->init_flag & RELOCS_DONE)
- return goof;
- tpnt->init_flag |= RELOCS_DONE;
- goof += _dl_parse_relocation_information(tpnt,
- tpnt->dynamic_info[DT_REL],
- tpnt->dynamic_info[DT_RELSZ], 0);
+ if(_dl_debug) _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);
#endif
- }
- if (tpnt->dynamic_info[DT_RELA]) {
-#ifndef ELF_USES_RELOCA
+
+ if (unlikely(tpnt->dynamic_info[UNSUPPORTED_RELOC_TYPE])) {
#if defined (__SUPPORT_LD_DEBUG__)
- if(_dl_debug) _dl_dprintf(2, "%s: can't handle RELA relocation records\n", _dl_progname);
-#endif
+ if(_dl_debug) {
+ _dl_dprintf(2, "%s: can't handle %s relocation records\n",
+ _dl_progname, UNSUPPORTED_RELOC_STR);
+ }
+#endif
goof++;
return goof;
-#else
+ }
+
+ if (tpnt->dynamic_info[DT_RELOC_TABLE_ADDR]) {
if (tpnt->init_flag & RELOCS_DONE)
return goof;
tpnt->init_flag |= RELOCS_DONE;
- goof += _dl_parse_relocation_information(tpnt,
- tpnt->dynamic_info[DT_RELA],
- tpnt->dynamic_info[DT_RELASZ], 0);
-#endif
+ goof += _dl_parse_relocation_information(tpnt,
+ tpnt->dynamic_info[DT_RELOC_TABLE_ADDR],
+ tpnt->dynamic_info[DT_RELOC_TABLE_SIZE], 0);
}
+
if (tpnt->dynamic_info[DT_JMPREL]) {
if (tpnt->init_flag & JMP_RELOCS_DONE)
return goof;
tpnt->init_flag |= JMP_RELOCS_DONE;
if (flag & RTLD_LAZY) {
- _dl_parse_lazy_relocation_information(tpnt,
- tpnt->dynamic_info[DT_JMPREL],
+ _dl_parse_lazy_relocation_information(tpnt,
+ tpnt->dynamic_info[DT_JMPREL],
tpnt->dynamic_info [DT_PLTRELSZ], 0);
} else {
- goof += _dl_parse_relocation_information(tpnt,
- tpnt->dynamic_info[DT_JMPREL],
+ goof += _dl_parse_relocation_information(tpnt,
+ tpnt->dynamic_info[DT_JMPREL],
tpnt->dynamic_info[DT_PLTRELSZ], 0);
}
}
+
if (tpnt->init_flag & COPY_RELOCS_DONE)
return goof;
tpnt->init_flag |= COPY_RELOCS_DONE;
-#ifdef ELF_USES_RELOCA
- goof += _dl_parse_copy_information(rpnt,
- tpnt->dynamic_info[DT_RELA], tpnt->dynamic_info[DT_RELASZ], 0);
-
-#else
- goof += _dl_parse_copy_information(rpnt, tpnt->dynamic_info[DT_REL],
- tpnt->dynamic_info[DT_RELSZ], 0);
-
-#endif
+ goof += _dl_parse_copy_information(rpnt,
+ tpnt->dynamic_info[DT_RELOC_TABLE_ADDR],
+ tpnt->dynamic_info[DT_RELOC_TABLE_SIZE], 0);
#if defined (__SUPPORT_LD_DEBUG__)
if(_dl_debug) {
- _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);
+ _dl_dprintf(_dl_debug_file,"\nrelocation processing: %s", tpnt->libname);
_dl_dprintf(_dl_debug_file,"; finished\n\n");
}
-#endif
+#endif
+
return goof;
}