mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-18 02:19:39 +00:00
libdtrace: Compute the relocation offset for all non-ET_REL objects
The use of an ifdef here most likely carries over from when the dtrace port only worked on x86 platforms. MFC after: 2 weeks Sponsored by: Innovate UK
This commit is contained in:
parent
f6372351da
commit
7bbcbd43c5
@ -1251,19 +1251,21 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
|
|||||||
* [Text][R/O data][R/W data][Dynamic][BSS][Non loadable]
|
* [Text][R/O data][R/W data][Dynamic][BSS][Non loadable]
|
||||||
*/
|
*/
|
||||||
dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va;
|
dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va;
|
||||||
#if defined(__i386__)
|
|
||||||
/*
|
if (!is_elf_obj) {
|
||||||
* Find the first load section and figure out the relocation
|
/*
|
||||||
* offset for the symbols. The kernel module will not need
|
* Find the first load section and figure out the relocation
|
||||||
* relocation, but the kernel linker modules will.
|
* offset for the symbols. The kernel module will not need
|
||||||
*/
|
* relocation, but the kernel linker modules will.
|
||||||
for (i = 0; gelf_getphdr(dmp->dm_elf, i, &ph) != NULL; i++) {
|
*/
|
||||||
if (ph.p_type == PT_LOAD) {
|
for (i = 0; gelf_getphdr(dmp->dm_elf, i, &ph) != NULL; i++) {
|
||||||
dmp->dm_reloc_offset = k_stat->address - ph.p_vaddr;
|
if (ph.p_type == PT_LOAD) {
|
||||||
break;
|
dmp->dm_reloc_offset =
|
||||||
|
k_stat->address - ph.p_vaddr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (dmp->dm_info.objfs_info_primary)
|
if (dmp->dm_info.objfs_info_primary)
|
||||||
dmp->dm_flags |= DT_DM_PRIMARY;
|
dmp->dm_flags |= DT_DM_PRIMARY;
|
||||||
|
Loading…
Reference in New Issue
Block a user