[uClibc-cvs] uClibc/ldso/ldso ldso.c, 1.79, 1.80 readelflib1.c, 1.55, 1.56
Erik Andersen
andersen at uclibc.org
Thu Jan 29 11:42:48 UTC 2004
Update of /var/cvs/uClibc/ldso/ldso
In directory nail:/tmp/cvs-serv13505/ldso
Modified Files:
ldso.c readelflib1.c
Log Message:
Scrub up use of ELF_USES_RELOCA and eliminte some unsightly ifdefs
Index: readelflib1.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/readelflib1.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- readelflib1.c 29 Jan 2004 10:44:49 -0000 1.55
+++ readelflib1.c 29 Jan 2004 11:42:46 -0000 1.56
@@ -874,74 +874,58 @@
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;
}
Index: ldso.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/ldso/ldso.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -d -r1.79 -r1.80
--- ldso.c 29 Jan 2004 10:44:49 -0000 1.79
+++ ldso.c 29 Jan 2004 11:42:45 -0000 1.80
@@ -565,17 +565,10 @@
unsigned long rel_addr, rel_size;
-#ifdef ELF_USES_RELOCA
- rel_addr = (indx ? tpnt->dynamic_info[DT_JMPREL] : tpnt->
- dynamic_info[DT_RELA]);
- rel_size = (indx ? tpnt->dynamic_info[DT_PLTRELSZ] : tpnt->
- dynamic_info[DT_RELASZ]);
-#else
rel_addr = (indx ? tpnt->dynamic_info[DT_JMPREL] : tpnt->
- dynamic_info[DT_REL]);
+ dynamic_info[DT_RELOC_TABLE_ADDR]);
rel_size = (indx ? tpnt->dynamic_info[DT_PLTRELSZ] : tpnt->
- dynamic_info[DT_RELSZ]);
-#endif
+ dynamic_info[DT_RELOC_TABLE_SIZE]);
if (!rel_addr)
continue;
More information about the uClibc-cvs
mailing list