/[base]
ViewVC logotype

Revision 313262


Jump to revision: Previous Next
Author: markj
Date: Sun Feb 5 02:39:12 2017 UTC (7 years, 4 months ago)
Changed paths: 6
Log Message:
Use PC-relative relocations for USDT probe sites on i386 and amd64.

When recording probe site addresses in the output DOF file, dtrace -G
needs to emit relocations for the .SUNW_dof section in order to obtain
the addresses of functions containing probe sites. DTrace expects the
addresses to be relative to the base address of the final ELF file,
and the amd64 USDT implementation was relying on some unspecified and
incorrect behaviour in the base system GNU ld to achieve this.

This change reimplements the probe site relocation handling to allow
USDT to be used with lld and newer GNU binutils. Specifically, it
makes use of R_X86_64_PC64/R_386_PC32 relocations to obtain the
probe site address relative to the DOF file address, and adds and uses a
new DOF relocation type which computes the final probe site address using
these relative offsets.

Reported by and discussed with:	Rafael EspĂ­ndola
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D9374


Changed paths

Path Details
Directoryhead/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c modified , text changed
Directoryhead/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c modified , text changed
Directoryhead/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c modified , text changed
Directoryhead/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c modified , text changed
Directoryhead/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h modified , text changed
Directoryhead/sys/cddl/dev/dtrace/dtrace_ioctl.c modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27