Explorar el Código

Guard debug_sym/debug_reloc, make sure elfinterp.c sees __SUPPORT_LD_DEBUG__

Peter S. Mazinger hace 19 años
padre
commit
0438ec7017

+ 4 - 0
ldso/ldso/arm/elfinterp.c

@@ -38,6 +38,8 @@
    a more than adequate job of explaining everything required to get this
    working. */
 
+#include "ldso.h"
+
 extern int _dl_linux_resolve(void);
 
 unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
@@ -128,8 +130,10 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
 
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
+#endif
 
 		res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
 

+ 2 - 0
ldso/ldso/cris/elfinterp.c

@@ -122,8 +122,10 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
 
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab, strtab, symtab_index);
 		debug_reloc(symtab, strtab, rpnt);
+#endif
 
 		/* Pass over to actual relocation function. */
 		res = reloc_fnc(tpnt, scope, rpnt, symtab, strtab);

+ 0 - 5
ldso/ldso/dl-debug.c

@@ -98,9 +98,4 @@ static void debug_reloc(ElfW(Sym) *symtab, char *strtab, ELF_RELOC *rpnt)
 	_dl_dprintf(_dl_debug_file, "\n");
 }
 
-#else
-
-#define debug_sym(symtab, strtab, symtab_index)
-#define debug_reloc(symtab, strtab, rpnt)
-
 #endif /* __SUPPORT_LD_DEBUG__ */

+ 5 - 2
ldso/ldso/frv/elfinterp.c

@@ -24,7 +24,7 @@ License along with uClibc; see the file COPYING.LIB.  If not, write to
 the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
 USA.  */
 
-#include <sys/cdefs.h>	    /* __attribute_used__ */
+#include <features.h>
 
 /* Program to load an ELF binary on a linux system, and run it.
    References to symbols in sharable libraries can be resolved by either
@@ -37,7 +37,7 @@ USA.  */
    a more than adequate job of explaining everything required to get this
    working. */
 
-struct funcdesc_value volatile *__attribute__((__visibility__("hidden")))
+struct funcdesc_value volatile attribute_hidden *
 _dl_linux_resolver (struct elf_resolve *tpnt, int reloc_entry)
 {
 	int reloc_type;
@@ -136,8 +136,11 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 	        int res;
 	    
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
+
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
+#endif
 
 		res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
 

+ 2 - 0
ldso/ldso/i386/elfinterp.c

@@ -123,8 +123,10 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
 
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab, strtab, symtab_index);
 		debug_reloc(symtab, strtab, rpnt);
+#endif
 
 		res = reloc_fnc(tpnt, scope, rpnt, symtab, strtab);
 

+ 2 - 0
ldso/ldso/m68k/elfinterp.c

@@ -40,6 +40,8 @@
    a more than adequate job of explaining everything required to get this
    working. */
 
+#include "ldso.h"
+
 extern int _dl_linux_resolve(void);
 
 unsigned int

+ 3 - 1
ldso/ldso/mips/elfinterp.c

@@ -27,6 +27,8 @@
  * SUCH DAMAGE.
  */
 
+#include "ldso.h"
+
 extern int _dl_runtime_resolve(void);
 
 #define OFFSET_GP_GOT 0x7ff0
@@ -119,9 +121,9 @@ int _dl_parse_relocation_information(struct dyn_elf *xpnt,
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
 		symbol_addr = 0;
 
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
-#if defined (__SUPPORT_LD_DEBUG__)
 		if (reloc_addr)
 			old_val = *reloc_addr;
 #endif

+ 5 - 1
ldso/ldso/powerpc/elfinterp.c

@@ -29,6 +29,8 @@
  * SUCH DAMAGE.
  */
 
+#include "ldso.h"
+
 extern int _dl_linux_resolve(void);
 
 void _dl_init_got(unsigned long *plt,struct elf_resolve *tpnt)
@@ -116,10 +118,10 @@ unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
 	strtab = (char *)tpnt->dynamic_info[DT_STRTAB];
 	symname = strtab + symtab[symtab_index].st_name;
 
+#if defined (__SUPPORT_LD_DEBUG__)
 	debug_sym(symtab,strtab,symtab_index);
 	debug_reloc(symtab,strtab,this_reloc);
 
-#if defined (__SUPPORT_LD_DEBUG__)
 	if (unlikely(ELF32_R_TYPE(this_reloc->r_info) != R_PPC_JMP_SLOT)) {
 		_dl_dprintf(2, "%s: Incorrect relocation type in jump relocation\n", _dl_progname);
 		_dl_exit(1);
@@ -363,8 +365,10 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
 
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
+#endif
 
 		res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
 

+ 5 - 0
ldso/ldso/sh/elfinterp.c

@@ -39,6 +39,8 @@
    a more than adequate job of explaining everything required to get this
    working. */
 
+#include "ldso.h"
+
 extern int _dl_linux_resolve(void);
 
 unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
@@ -122,8 +124,11 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 		int res;
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
+
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
+#endif
 
 		res = reloc_fnc(tpnt, scope, rpnt, symtab, strtab);
 

+ 5 - 0
ldso/ldso/sh64/elfinterp.c

@@ -41,6 +41,8 @@
    a more than adequate job of explaining everything required to get this
    working. */
 
+#include "ldso.h"
+
 extern int _dl_linux_resolve(void);
 
 unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
@@ -132,8 +134,11 @@ static int _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 		int res;
 
 		symtab_index = ELF32_R_SYM(rpnt->r_info);
+
+#ifdef __SUPPORT_LD_DEBUG__
 		debug_sym(symtab,strtab,symtab_index);
 		debug_reloc(symtab,strtab,rpnt);
+#endif
 
 		res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab);
 		if (res == 0)

+ 2 - 0
ldso/ldso/x86_64/elfinterp.c

@@ -125,8 +125,10 @@ _dl_parse(struct elf_resolve *tpnt, struct dyn_elf *scope,
 
 		symtab_index = ELF_R_SYM(rpnt->r_info);
 
+#if defined (__SUPPORT_LD_DEBUG__)
 		debug_sym(symtab, strtab, symtab_index);
 		debug_reloc(symtab, strtab, rpnt);
+#endif
 
 		res = reloc_fnc(tpnt, scope, rpnt, symtab, strtab);