summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2014-02-17 14:51:02 +0000
committermarkj <markj@FreeBSD.org>2014-02-17 14:51:02 +0000
commit9a6dcea530c74578e68091504a1abefc3e175832 (patch)
treec9614758fbd332e567b5a426db74f4c8b2882473 /cddl
parentcc43c81b039ea4e8f8aec917d7a7cb781e320310 (diff)
downloadFreeBSD-src-9a6dcea530c74578e68091504a1abefc3e175832.zip
FreeBSD-src-9a6dcea530c74578e68091504a1abefc3e175832.tar.gz
MFC r260051:
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.
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c15
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 ee68479..9d3b0ed 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;
OpenPOWER on IntegriCloud