diff options
author | Robert Mustacchi <rm@joyent.com> | 2015-08-15 06:46:35 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2015-08-30 16:28:25 +0000 |
commit | 42e0d8eb0785d1dfe1500caf804983265763102f (patch) | |
tree | 4b47fa1cc7a7bac9ed80dcccec69b3e89e946e09 /usr/src/lib/libctf/common | |
parent | 997c62b9dd56613418cda38d2e2fb21cc9e45df6 (diff) | |
download | illumos-joyent-42e0d8eb0785d1dfe1500caf804983265763102f.tar.gz |
OS-4651 don't convert weak symbols when multiple dies present
Diffstat (limited to 'usr/src/lib/libctf/common')
-rw-r--r-- | usr/src/lib/libctf/common/ctf_dwarf.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/usr/src/lib/libctf/common/ctf_dwarf.c b/usr/src/lib/libctf/common/ctf_dwarf.c index 72e5aa9bd9..1e684641fe 100644 --- a/usr/src/lib/libctf/common/ctf_dwarf.c +++ b/usr/src/lib/libctf/common/ctf_dwarf.c @@ -267,6 +267,7 @@ typedef struct ctf_die { size_t cd_errlen; /* error message buffer length */ size_t cd_ptrsz; /* object's pointer size */ boolean_t cd_bigend; /* is it big endian */ + boolean_t cd_doweaks; /* should we convert weak symbols? */ uint_t cd_mach; /* machine type */ ctf_id_t cd_voidtid; /* void pointer */ ctf_id_t cd_longtid; /* id for a 'long' */ @@ -2549,14 +2550,16 @@ ctf_dwarf_convert_one(void *arg, void *unused) "failed to update output ctf container")); } - if ((ret = ctf_dwarf_conv_weaks(cdp)) != 0) { - return (ctf_dwarf_error(cdp, NULL, ret, - "failed to convert weak functions and variables")); - } + if (cdp->cd_doweaks == B_TRUE) { + if ((ret = ctf_dwarf_conv_weaks(cdp)) != 0) { + return (ctf_dwarf_error(cdp, NULL, ret, + "failed to convert weak functions and variables")); + } - if (ctf_update(cdp->cd_ctfp) != 0) { - return (ctf_dwarf_error(cdp, cdp->cd_ctfp, 0, - "failed to update output ctf container")); + if (ctf_update(cdp->cd_ctfp) != 0) { + return (ctf_dwarf_error(cdp, cdp->cd_ctfp, 0, + "failed to update output ctf container")); + } } ctf_phase_dump(cdp->cd_ctfp, "pre-dedup"); @@ -2862,6 +2865,7 @@ ctf_dwarf_convert(int fd, Elf *elf, uint_t nthrs, int *errp, ctf_file_t **fpp, *errp = ret; goto out; } + cdp->cd_doweaks = ndies > 1 ? B_FALSE : B_TRUE; } ctf_dprintf("found %d DWARF die(s)\n", ndies); |