diff options
-rw-r--r-- | ldso/ldso/dl-debug.c | 7 | ||||
-rw-r--r-- | ldso/ldso/mips/dl-debug.h | 72 |
2 files changed, 62 insertions, 17 deletions
diff --git a/ldso/ldso/dl-debug.c b/ldso/ldso/dl-debug.c index c105d89db..c2b2d9d23 100644 --- a/ldso/ldso/dl-debug.c +++ b/ldso/ldso/dl-debug.c @@ -6,7 +6,7 @@ * Copyright (C) 2001-2004 Erik Andersen * Copyright (C) 2002-2004, Axis Communications AB * Copyright (C) 2003, 2004 Red Hat, Inc. - * Copyright (C) 2002, Steven J. Hill (sjhill@realitydiluted.com) + * Copyright (C) 2002, 2005 Steven J. Hill (sjhill@realitydiluted.com) * Copyright (C) 2001-2002 David A. Schleef * Copyright (C) 2004 Joakim Tjernlund * Copyright (C) 2002, Stefan Allius <allius@atecom.com> and @@ -52,11 +52,16 @@ static const char *_dl_reltypes(int type) tabsize = (int)(sizeof(_dl_reltypes_tab) / sizeof(_dl_reltypes_tab[0])); +#ifdef __mips__ + _dl_populate_reltypes_tab(); +#endif + if (type >= tabsize || (str = _dl_reltypes_tab[type]) == NULL) str = _dl_simple_ltoa(buf, (unsigned long)type); return str; } + static void debug_sym(ElfW(Sym) *symtab, char *strtab, int symtab_index) { if (!_dl_debug_symbols || !symtab_index) diff --git a/ldso/ldso/mips/dl-debug.h b/ldso/ldso/mips/dl-debug.h index f2a3865e3..9351651bc 100644 --- a/ldso/ldso/mips/dl-debug.h +++ b/ldso/ldso/mips/dl-debug.h @@ -1,7 +1,7 @@ /* vi: set sw=4 ts=4: */ /* mips/mipsel ELF shared library loader suppport * - Copyright (C) 2002, Steven J. Hill (sjhill@realitydiluted.com) + Copyright (C) 2002, 2005 Steven J. Hill (sjhill@realitydiluted.com) * * All rights reserved. * @@ -27,19 +27,59 @@ * SUCH DAMAGE. */ -static const char *_dl_reltypes_tab[] = +static const char *_dl_reltypes_tab[R_MIPS_NUM]; + +void _dl_populate_reltypes_tab(void) { - [0] "R_MIPS_NONE", "R_MIPS_16", "R_MIPS_32", - [3] "R_MIPS_REL32", "R_MIPS_26", "R_MIPS_HI16", - [6] "R_MIPS_LO16", "R_MIPS_GPREL16", "R_MIPS_LITERAL", - [9] "R_MIPS_GOT16", "R_MIPS_PC16", "R_MIPS_CALL16", - [12] "R_MIPS_GPREL32", - [16] "R_MIPS_SHIFT5", "R_MIPS_SHIFT6", "R_MIPS_64", - [19] "R_MIPS_GOT_DISP", "R_MIPS_GOT_PAGE", "R_MIPS_GOT_OFST", - [22] "R_MIPS_GOT_HI16", "R_MIPS_GOT_LO16", "R_MIPS_SUB", - [25] "R_MIPS_INSERT_A", "R_MIPS_INSERT_B", "R_MIPS_DELETE", - [28] "R_MIPS_HIGHER", "R_MIPS_HIGHEST", "R_MIPS_CALL_HI16", - [31] "R_MIPS_CALL_LO16", "R_MIPS_SCN_DISP", "R_MIPS_REL16", - [34] "R_MIPS_ADD_IMMEDIATE", "R_MIPS_PJUMP", "R_MIPS_RELGOT", - [37] "R_MIPS_JALR", -}; + _dl_reltypes_tab [0] = "R_MIPS_NONE"; + _dl_reltypes_tab [1] = "R_MIPS_16"; + _dl_reltypes_tab [2] = "R_MIPS_32"; + _dl_reltypes_tab [3] = "R_MIPS_REL32"; + _dl_reltypes_tab [4] = "R_MIPS_26"; + _dl_reltypes_tab [5] = "R_MIPS_HI16"; + _dl_reltypes_tab [6] = "R_MIPS_LO16"; + _dl_reltypes_tab [7] = "R_MIPS_GPREL16"; + _dl_reltypes_tab [8] = "R_MIPS_LITERAL"; + _dl_reltypes_tab [9] = "R_MIPS_GOT16"; + _dl_reltypes_tab[10] = "R_MIPS_PC16"; + _dl_reltypes_tab[11] = "R_MIPS_CALL16"; + _dl_reltypes_tab[12] = "R_MIPS_GPREL32"; + _dl_reltypes_tab[13] = ""; + _dl_reltypes_tab[14] = ""; + _dl_reltypes_tab[15] = ""; + _dl_reltypes_tab[16] = "R_MIPS_SHIFT5"; + _dl_reltypes_tab[17] = "R_MIPS_SHIFT6"; + _dl_reltypes_tab[18] = "R_MIPS_64"; + _dl_reltypes_tab[19] = "R_MIPS_GOT_DISP"; + _dl_reltypes_tab[20] = "R_MIPS_GOT_PAGE"; + _dl_reltypes_tab[21] = "R_MIPS_GOT_OFST"; + _dl_reltypes_tab[22] = "R_MIPS_GOT_HI16"; + _dl_reltypes_tab[23] = "R_MIPS_GOT_LO16"; + _dl_reltypes_tab[24] = "R_MIPS_SUB"; + _dl_reltypes_tab[25] = "R_MIPS_INSERT_A"; + _dl_reltypes_tab[26] = "R_MIPS_INSERT_B"; + _dl_reltypes_tab[27] = "R_MIPS_DELETE"; + _dl_reltypes_tab[28] = "R_MIPS_HIGHER"; + _dl_reltypes_tab[29] = "R_MIPS_HIGHEST"; + _dl_reltypes_tab[30] = "R_MIPS_CALL_HI16"; + _dl_reltypes_tab[31] = "R_MIPS_CALL_LO16"; + _dl_reltypes_tab[32] = "R_MIPS_SCN_DISP"; + _dl_reltypes_tab[33] = "R_MIPS_REL16"; + _dl_reltypes_tab[34] = "R_MIPS_ADD_IMMEDIATE"; + _dl_reltypes_tab[35] = "R_MIPS_PJUMP"; + _dl_reltypes_tab[36] = "R_MIPS_RELGOT"; + _dl_reltypes_tab[37] = "R_MIPS_JALR"; + _dl_reltypes_tab[38] = "R_MIPS_TLS_DTPMOD32"; + _dl_reltypes_tab[39] = "R_MIPS_TLS_DTPREL32"; + _dl_reltypes_tab[40] = "R_MIPS_TLS_DTPMOD64"; + _dl_reltypes_tab[41] = "R_MIPS_TLS_DTPREL64"; + _dl_reltypes_tab[42] = "R_MIPS_TLS_GD"; + _dl_reltypes_tab[43] = "R_MIPS_TLS_LDM"; + _dl_reltypes_tab[44] = "R_MIPS_TLS_DTPREL_HI16"; + _dl_reltypes_tab[45] = "R_MIPS_TLS_DTPREL_LO16"; + _dl_reltypes_tab[46] = "R_MIPS_TLS_GOTTPREL"; + _dl_reltypes_tab[47] = "R_MIPS_TLS_TPREL32"; + _dl_reltypes_tab[48] = "R_MIPS_TLS_TPREL64"; + _dl_reltypes_tab[49] = "R_MIPS_TLS_TPREL_HI16"; + _dl_reltypes_tab[50] = "R_MIPS_TLS_TPREL_LO16"; +} |