summaryrefslogtreecommitdiff
path: root/ldso/ldso/frv
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-07 00:14:11 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-07 00:14:11 +0000
commitce9f1cf9c26bbc4e0cf23c14d8058e1847b1dd8a (patch)
tree7b250ef0c3be4c7d926eaffdd9bbf00d18bf5695 /ldso/ldso/frv
parentf7eee81da43d9e40395d6e3a21883bd64b3f63ce (diff)
rip out all the duplicated debug code and move into a shared file
Diffstat (limited to 'ldso/ldso/frv')
-rw-r--r--ldso/ldso/frv/dl-debug.h43
-rw-r--r--ldso/ldso/frv/elfinterp.c79
2 files changed, 43 insertions, 79 deletions
diff --git a/ldso/ldso/frv/dl-debug.h b/ldso/ldso/frv/dl-debug.h
new file mode 100644
index 000000000..8d392d319
--- /dev/null
+++ b/ldso/ldso/frv/dl-debug.h
@@ -0,0 +1,43 @@
+/* FR-V FDPIC ELF shared library loader suppport
+ Copyright (C) 2003, 2004 Red Hat, Inc.
+ Contributed by Alexandre Oliva <aoliva@redhat.com>
+ Lots of code copied from ../i386/elfinterp.c, so:
+ Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald,
+ David Engel, Hongjiu Lu and Mitch D'Souza
+ Copyright (C) 2001-2002, Erik Andersen
+ All rights reserved.
+
+This file is part of uClibc.
+
+uClibc is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of the
+License, or (at your option) any later version.
+
+uClibc is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+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. */
+
+static const char *_dl_reltypes_tab[] =
+{
+ [0] "R_FRV_NONE", "R_FRV_32",
+ [2] "R_FRV_LABEL16", "R_FRV_LABEL24",
+ [4] "R_FRV_LO16", "R_FRV_HI16",
+ [6] "R_FRV_GPREL12", "R_FRV_GPRELU12",
+ [8] "R_FRV_GPREL32", "R_FRV_GPRELHI", "R_FRV_GPRELLO",
+ [11] "R_FRV_GOT12", "R_FRV_GOTHI", "R_FRV_GOTLO",
+ [14] "R_FRV_FUNCDESC",
+ [15] "R_FRV_FUNCDESC_GOT12", "R_FRV_FUNCDESC_GOTHI", "R_FRV_FUNCDESC_GOTLO",
+ [18] "R_FRV_FUNCDESC_VALUE", "R_FRV_FUNCDESC_GOTOFF12",
+ [20] "R_FRV_FUNCDESC_GOTOFFHI", "R_FRV_FUNCDESC_GOTOFFLO",
+ [22] "R_FRV_GOTOFF12", "R_FRV_GOTOFFHI", "R_FRV_GOTOFFLO",
+#if 0
+ [200] "R_FRV_GNU_VTINHERIT", "R_FRV_GNU_VTENTRY"
+#endif
+};
diff --git a/ldso/ldso/frv/elfinterp.c b/ldso/ldso/frv/elfinterp.c
index 9ab1a9777..cccf9b70c 100644
--- a/ldso/ldso/frv/elfinterp.c
+++ b/ldso/ldso/frv/elfinterp.c
@@ -26,83 +26,6 @@ USA. */
#include <sys/cdefs.h> /* __attribute_used__ */
-#if defined (__SUPPORT_LD_DEBUG__)
-static const char *_dl_reltypes_tab[] =
-{
- [0] "R_FRV_NONE", "R_FRV_32",
- [2] "R_FRV_LABEL16", "R_FRV_LABEL24",
- [4] "R_FRV_LO16", "R_FRV_HI16",
- [6] "R_FRV_GPREL12", "R_FRV_GPRELU12",
- [8] "R_FRV_GPREL32", "R_FRV_GPRELHI", "R_FRV_GPRELLO",
- [11] "R_FRV_GOT12", "R_FRV_GOTHI", "R_FRV_GOTLO",
- [14] "R_FRV_FUNCDESC",
- [15] "R_FRV_FUNCDESC_GOT12", "R_FRV_FUNCDESC_GOTHI", "R_FRV_FUNCDESC_GOTLO",
- [18] "R_FRV_FUNCDESC_VALUE", "R_FRV_FUNCDESC_GOTOFF12",
- [20] "R_FRV_FUNCDESC_GOTOFFHI", "R_FRV_FUNCDESC_GOTOFFLO",
- [22] "R_FRV_GOTOFF12", "R_FRV_GOTOFFHI", "R_FRV_GOTOFFLO",
-#if 0
- [200] "R_FRV_GNU_VTINHERIT", "R_FRV_GNU_VTENTRY"
-#endif
-};
-
-static const char *
-_dl_reltypes(int type)
-{
- static char buf[22];
- const char *str;
-
- if (type >= (int)(sizeof (_dl_reltypes_tab)/sizeof(_dl_reltypes_tab[0])) ||
- NULL == (str = _dl_reltypes_tab[type]))
- {
- str =_dl_simple_ltoa( buf, (unsigned long)(type));
- }
- return str;
-}
-
-static
-void debug_sym(Elf32_Sym *symtab,char *strtab,int symtab_index)
-{
- if(_dl_debug_symbols)
- {
- if(symtab_index){
- _dl_dprintf(_dl_debug_file, "\n%s\n\tvalue=%x\tsize=%x\tinfo=%x\tother=%x\tshndx=%x",
- strtab + symtab[symtab_index].st_name,
- symtab[symtab_index].st_value,
- symtab[symtab_index].st_size,
- symtab[symtab_index].st_info,
- symtab[symtab_index].st_other,
- symtab[symtab_index].st_shndx);
- }
- }
-}
-
-static void debug_reloc(Elf32_Sym *symtab,char *strtab, ELF_RELOC *rpnt)
-{
- if(_dl_debug_reloc)
- {
- int symtab_index;
- const char *sym;
- symtab_index = ELF32_R_SYM(rpnt->r_info);
- sym = symtab_index ? strtab + symtab[symtab_index].st_name : "sym=0x0";
-
- if(_dl_debug_symbols)
- _dl_dprintf(_dl_debug_file, "\n\t");
- else
- _dl_dprintf(_dl_debug_file, "\n%s\n\t", sym);
-#ifdef ELF_USES_RELOCA
- _dl_dprintf(_dl_debug_file, "%s\toffset=%x\taddend=%x",
- _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
- rpnt->r_offset,
- rpnt->r_addend);
-#else
- _dl_dprintf(_dl_debug_file, "%s\toffset=%x\n",
- _dl_reltypes(ELF32_R_TYPE(rpnt->r_info)),
- rpnt->r_offset);
-#endif
- }
-}
-#endif
-
/* Program to load an ELF binary on a linux system, and run it.
References to symbols in sharable libraries can be resolved by either
an ELF sharable library or a linux style of shared library. */
@@ -213,10 +136,8 @@ _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);