diff options
| author | Rod Evans <Rod.Evans@Sun.COM> | 2009-10-14 08:12:49 -0700 |
|---|---|---|
| committer | Rod Evans <Rod.Evans@Sun.COM> | 2009-10-14 08:12:49 -0700 |
| commit | 635216b673cf196ac523ff2a7ab715717e553292 (patch) | |
| tree | af717579eb7652519f97c86ec06d835b67c9b196 /usr/src/cmd/sgs/liblddbg | |
| parent | 96400bb6b8e1e66106f3b1de3cf1dbd8268e581c (diff) | |
| download | illumos-joyent-635216b673cf196ac523ff2a7ab715717e553292.tar.gz | |
6888489 Null environment variables are not overriding crle(1) replaceable environment variables.
Diffstat (limited to 'usr/src/cmd/sgs/liblddbg')
| -rw-r--r-- | usr/src/cmd/sgs/liblddbg/common/_debug.h | 12 | ||||
| -rw-r--r-- | usr/src/cmd/sgs/liblddbg/common/liblddbg.msg | 20 | ||||
| -rw-r--r-- | usr/src/cmd/sgs/liblddbg/common/relocate.c | 52 | ||||
| -rw-r--r-- | usr/src/cmd/sgs/liblddbg/common/syms.c | 2 |
4 files changed, 64 insertions, 22 deletions
diff --git a/usr/src/cmd/sgs/liblddbg/common/_debug.h b/usr/src/cmd/sgs/liblddbg/common/_debug.h index e8606f859a..294f0d08f0 100644 --- a/usr/src/cmd/sgs/liblddbg/common/_debug.h +++ b/usr/src/cmd/sgs/liblddbg/common/_debug.h @@ -130,14 +130,16 @@ typedef struct { #define MSG_REL_RTN_ENTRY MSG_REL_RTN_ENTRY_64 #define MSG_REL_LDSA_TITLE MSG_REL_LDSA_TITLE_64 #define MSG_REL_LDSN_TITLE MSG_REL_LDSN_TITLE_64 -#define MSG_REL_LDSV_TITLE MSG_REL_LDSV_TITLE_64 #define MSG_REL_LDSA_ENTRY MSG_REL_LDSA_ENTRY_64 #define MSG_REL_LDSN_ENTRY MSG_REL_LDSN_ENTRY_64 +#define MSG_REL_LDSV_TITLE MSG_REL_LDSV_TITLE_64 +#define MSG_REL_LDSV_ENTRY MSG_REL_LDSV_ENTRY_64 #define MSG_REL_LDLA_TITLE MSG_REL_LDLA_TITLE_64 #define MSG_REL_LDLN_TITLE MSG_REL_LDLN_TITLE_64 -#define MSG_REL_LDLV_TITLE MSG_REL_LDLV_TITLE_64 #define MSG_REL_LDLA_ENTRY MSG_REL_LDLA_ENTRY_64 #define MSG_REL_LDLN_ENTRY MSG_REL_LDLN_ENTRY_64 +#define MSG_REL_LDLV_TITLE MSG_REL_LDLV_TITLE_64 +#define MSG_REL_LDLV_ENTRY MSG_REL_LDLV_ENTRY_64 #define MSG_SHD_ADDR MSG_SHD_ADDR_64 #define MSG_SHD_SIZE MSG_SHD_SIZE_64 @@ -185,14 +187,16 @@ typedef struct { #define MSG_REL_RTN_ENTRY MSG_REL_RTN_ENTRY_32 #define MSG_REL_LDSA_TITLE MSG_REL_LDSA_TITLE_32 #define MSG_REL_LDSN_TITLE MSG_REL_LDSN_TITLE_32 -#define MSG_REL_LDSV_TITLE MSG_REL_LDSV_TITLE_32 #define MSG_REL_LDSA_ENTRY MSG_REL_LDSA_ENTRY_32 #define MSG_REL_LDSN_ENTRY MSG_REL_LDSN_ENTRY_32 +#define MSG_REL_LDSV_TITLE MSG_REL_LDSV_TITLE_32 +#define MSG_REL_LDSV_ENTRY MSG_REL_LDSV_ENTRY_32 #define MSG_REL_LDLA_TITLE MSG_REL_LDLA_TITLE_32 #define MSG_REL_LDLN_TITLE MSG_REL_LDLN_TITLE_32 -#define MSG_REL_LDLV_TITLE MSG_REL_LDLV_TITLE_32 #define MSG_REL_LDLA_ENTRY MSG_REL_LDLA_ENTRY_32 #define MSG_REL_LDLN_ENTRY MSG_REL_LDLN_ENTRY_32 +#define MSG_REL_LDLV_TITLE MSG_REL_LDLV_TITLE_32 +#define MSG_REL_LDLV_ENTRY MSG_REL_LDLV_ENTRY_32 #define MSG_SHD_ADDR MSG_SHD_ADDR_32 #define MSG_SHD_SIZE MSG_SHD_SIZE_32 diff --git a/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg b/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg index 18ab37ea63..0add04165c 100644 --- a/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg +++ b/usr/src/cmd/sgs/liblddbg/common/liblddbg.msg @@ -1118,7 +1118,6 @@ @ MSG_CAP_HWFILTR_2 "dir=%s; no hardware capability objects found" - @ MSG_ELF_HEADER "ELF Header" # Capabilities entries. @@ -1292,11 +1291,12 @@ offset addend section symbol" @ MSG_REL_LDSN_TITLE_32 " type \ offset section symbol" -@ MSG_REL_LDSV_TITLE_32 " type \ - offset value section symbol" @ MSG_REL_LDSA_ENTRY_32 " %5s %-24s %#10llx %#10llx %-14.14s %s %s" @ MSG_REL_LDSN_ENTRY_32 " %5s %-24s %#10llx %-14.14s %s %s" +@ MSG_REL_LDSV_TITLE_32 " type \ + offset value section symbol" + # TRANSLATION_NOTE - the following strings are used by ld(1). These strings # provide for a series of one or more 32-bit relocation table entries, using # long section names, that align with one of the initial titles. @@ -1305,11 +1305,11 @@ offset addend section / symbol" @ MSG_REL_LDLN_TITLE_32 " type \ offset section / symbol" -@ MSG_REL_LDLV_TITLE_32 " type \ - offset value section / symbol" @ MSG_REL_LDLA_ENTRY_32 " %5s %-24s %#10llx %#10llx %-14s %s %s" @ MSG_REL_LDLN_ENTRY_32 " %5s %-24s %#10llx %-14s %s %s" +@ MSG_REL_LDLV_TITLE_32 " type \ + offset value section / symbol" # TRANSLATION_NOTE - the following strings are used by elfdump(1). These # strings provide for a series of one or more 64-bit relocation table entries, @@ -1356,11 +1356,12 @@ offset addend section symbol" @ MSG_REL_LDSN_TITLE_64 " type \ offset section symbol" -@ MSG_REL_LDSV_TITLE_64 " type \ - offset value section symbol" @ MSG_REL_LDSA_ENTRY_64 " %5s %-24s %#18llx %#18llx %-14.14s %s %s" @ MSG_REL_LDSN_ENTRY_64 " %5s %-24s %#18llx %-14.14s %s %s" +@ MSG_REL_LDSV_TITLE_64 " type \ + offset value section symbol" + # TRANSLATION_NOTE - the following strings are used by ld(1). These strings # provide for a series of one or more 64-bit relocation table entries, using # long section names, that align with one of the initial titles. @@ -1369,11 +1370,12 @@ offset addend section / symbol" @ MSG_REL_LDLN_TITLE_64 " type \ offset section / symbol" -@ MSG_REL_LDLV_TITLE_64 " type \ - offset value section / symbol" @ MSG_REL_LDLA_ENTRY_64 " %5s %-24s %#18llx %#18llx %-14s %s %s" @ MSG_REL_LDLN_ENTRY_64 " %5s %-24s %#18llx %-14s %s %s" +@ MSG_REL_LDLV_TITLE_64 " type \ + offset value section / symbol" + @ _END_ # Debug enabling tokens (for now these are untranslated) diff --git a/usr/src/cmd/sgs/liblddbg/common/relocate.c b/usr/src/cmd/sgs/liblddbg/common/relocate.c index d9d6d33610..6d1c8bb227 100644 --- a/usr/src/cmd/sgs/liblddbg/common/relocate.c +++ b/usr/src/cmd/sgs/liblddbg/common/relocate.c @@ -205,7 +205,7 @@ Dbg_reloc_doact_title(Lm_list *lml) Dbg_util_nl(lml, DBG_NL_STD); dbg_print(lml, MSG_INTL(MSG_REL_ACTIVE)); - Elf_reloc_title(lml, ELF_DBG_LD, 0); + Elf_reloc_title(lml, ELF_DBG_LD_ACT, 0); } void @@ -530,13 +530,6 @@ Elf_reloc_title(Lm_list *lml, int caller, Word type) return; } if (caller == ELF_DBG_LD) { - if (type == 0) { - if (DBG_NOTLONG()) - dbg_print(lml, MSG_INTL(MSG_REL_LDSV_TITLE)); - else - dbg_print(lml, MSG_INTL(MSG_REL_LDLV_TITLE)); - return; - } if (type == SHT_RELA) { if (DBG_NOTLONG()) dbg_print(lml, MSG_INTL(MSG_REL_LDSA_TITLE)); @@ -548,6 +541,14 @@ Elf_reloc_title(Lm_list *lml, int caller, Word type) else dbg_print(lml, MSG_INTL(MSG_REL_LDLN_TITLE)); } + return; + } + if (caller == ELF_DBG_LD_ACT) { + if (DBG_NOTLONG()) + dbg_print(lml, MSG_INTL(MSG_REL_LDSV_TITLE)); + else + dbg_print(lml, MSG_INTL(MSG_REL_LDLV_TITLE)); + return; } } @@ -611,6 +612,41 @@ Elf_reloc_entry_2(Lm_list *lml, int caller, const char *prestr, Word type, prestr, typestr, EC_OFF(off), secname, symname, poststr); } + return; + } + if (caller == ELF_DBG_LD_ACT) { + longlong_t value = EC_SXWORD(add); + + /* + * The following diagnostics are used to create active + * relocation output. A "value" field is specified in the + * same column as a RELA addend. + * + * We have to work around an issue caused by the use of a + * common format string to handle both the 32-bit and 64-bit + * cases. 'add' is a signed value. In the ELFCLASS32 case + * where add is a 32-bit value, the EC_SXWORD() macro widens + * it to a 64-bit signed value, which will cause sign extension + * in the upper 32-bits. As we are displaying the value in hex, + * this causes our 32-bit value to be displayed with 16 hex + * digits instead of 8, as would be appropriate for ELFCLASS32. + * + * The solution is to mask off the unwanted bits before + * formatting the value. The use of 'longlong_t' instead of + * Elf64_Sxword (used by the EC_SXWORD macro) is for the + * benefit of lint. + */ +#if !defined(_ELF64) + value &= 0xffffffff; +#endif + if (DBG_NOTLONG()) + dbg_print(lml, MSG_INTL(MSG_REL_LDSA_ENTRY), + prestr, typestr, EC_OFF(off), + value, secname, symname, poststr); + else + dbg_print(lml, MSG_INTL(MSG_REL_LDLA_ENTRY), + prestr, typestr, EC_OFF(off), + value, secname, symname, poststr); } } diff --git a/usr/src/cmd/sgs/liblddbg/common/syms.c b/usr/src/cmd/sgs/liblddbg/common/syms.c index 97513d1a48..a50f2cec75 100644 --- a/usr/src/cmd/sgs/liblddbg/common/syms.c +++ b/usr/src/cmd/sgs/liblddbg/common/syms.c @@ -495,7 +495,7 @@ Dbg_syms_reduce(Ofl_desc *ofl, int which, Sym_desc *sdp, int idx, dbg_print(lml, MSG_INTL(MSG_SYM_RETAINING)); } - if ((sdp->sd_flags1 & FLG_SY1_ELIM) && isfromglobal) + if ((sdp->sd_flags & FLG_SY_ELIM) && isfromglobal) dbg_print(lml, MSG_INTL(MSG_SYM_ELIMINATING), Dbg_demangle_name(sdp->sd_name)); else if (isfromglobal) |
