freebsd-dev/cddl
Andriy Gapon 556cb98d95 dtrace: correctly map sections to addresses in elf object modules (amd64)
Unlike for modules with dso type, in elf object modules all the sections
have virtual address of zero.  So, it is insufficient to add module base
address to section virtual address (as recorded in section header) to
get section address in kernel memory.
Instead, we should apply the same calculations that are performed by
kernel loaders (in boot code and in kernel) when they lay out sections
in memory.
Also, unlike OpenSolaris, the sections are not collapsed into just .text,
.data and .bss by module loaders, so we need to take additional care
about other sections.

Note that in-kernel symbol-to-address mapping worked just fine, e.g. fbt
provider could correctly find the functions, etc.  It's only in userland
that the mapping in both direction worked incorrectly, e.g. in stack()
output addresses of functions in kernel modules were not translated to
their names.

Reviewed by:	rpaulo
MFC after:	3 weeks
2010-07-23 17:32:47 +00:00
..
compat/opensolaris Merge ZFS version 15 and almost all OpenSolaris bugfixes referenced 2010-07-12 23:49:04 +00:00
contrib/opensolaris dtrace: correctly map sections to addresses in elf object modules (amd64) 2010-07-23 17:32:47 +00:00
lib Remove manual .includes in cddl Makefiles 2010-03-02 19:04:07 +00:00
sbin Remove manual .includes in cddl Makefiles 2010-03-02 19:04:07 +00:00
usr.bin Remove manual .includes in cddl Makefiles 2010-03-02 19:04:07 +00:00
usr.sbin Remove manual .includes in cddl Makefiles 2010-03-02 19:04:07 +00:00
Makefile Apply a set of style.Makefile(5) changes to src/cddl/ makefiles. 2007-04-16 21:20:26 +00:00
Makefile.inc Remove manual .includes in cddl Makefiles 2010-03-02 19:04:07 +00:00