diff options
author | markj <markj@FreeBSD.org> | 2013-12-29 19:27:32 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2013-12-29 19:27:32 +0000 |
commit | b05e082ecff9e81957e4d4848da0d632ecb0c7cf (patch) | |
tree | 03e2920f03704aac8e0e1f68b5a9169427ba2f0e /cddl | |
parent | ba75bc0251700840158ba007b393bae187f2ac3f (diff) | |
download | FreeBSD-src-b05e082ecff9e81957e4d4848da0d632ecb0c7cf.zip FreeBSD-src-b05e082ecff9e81957e4d4848da0d632ecb0c7cf.tar.gz |
When clearing relocations to __dtrace* symbols, handle both SHT_REL and
SHT_RELA sections properly instead of assuming that the relocation section
is of type SHT_REL.
Submitted by: Prashanth Kumar <pra_udupi@yahoo.co.in> (original version)
MFC after: 1 month
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c index 6561c93..f31c600 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c @@ -1620,10 +1620,17 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *eprobesp) * the executable file as the symbol is going to be * change from UND to ABS. */ - rela.r_offset = 0; - rela.r_info = 0; - rela.r_addend = 0; - (void) gelf_update_rela(data_rel, i, &rela); + if (shdr_rel.sh_type == SHT_RELA) { + rela.r_offset = 0; + rela.r_info = 0; + rela.r_addend = 0; + (void) gelf_update_rela(data_rel, i, &rela); + } else { + GElf_Rel rel; + rel.r_offset = 0; + rel.r_info = 0; + (void) gelf_update_rel(data_rel, i, &rel); + } #endif mod = 1; |