#
361088 |
|
15-May-2020 |
dim |
Merge changes that enable DTrace-using ports to link correctly with lld 10, avoiding "unknown relocation 8" and other errors.
MFC r312658 (by markj):
Remove the DTRACEHIOC_ADD ioctl.
This ioctl has been considered legacy by upstream since the DTrace code was first imported, and is unused. The removal also allows some simplification of dtrace_helper_slurp().
Also remove a bogus copyout in the DTRACEHIOC_ADDDOF handler. Due to a bug, it would overwrite an in-memory copy of the DOF header rather than the passed-in DOF helper. Moreover, DTRACEHIOC_ADDDOF already copies the helper back out automatically since its argument has the IOC_OUT attribute.
MFC r313262 (by markj):
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 Differential Revision: https://reviews.freebsd.org/D9374
|
#
274637 |
|
17-Nov-2014 |
markj |
DTrace imposes a 128-byte limit on the length of the function component of a probe name. When dtrace -G builds up a DOF section for the specified provider(s), the probe function names are truncated to fit in this limit. The DOF is later used to build the symbol table for the generated object file, so the table can end up with truncated references, causing link errors.
Instead of potentially truncating symbol table entries, write the full function name to the DOF string table and allow the kernel to enforce the 128-byte function name limit when a process attempts to load its DOF.
PR: 194757 Differential Revision: https://reviews.freebsd.org/D1175 Reviewed by: rpaulo MFC after: 2 weeks
|