Summary: | Kernel debugger only reads .dynsym even if .symtab exists | ||
---|---|---|---|
Product: | Base System | Reporter: | Alex Richardson <arichardson> |
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | New --- | ||
Severity: | Affects Some People | CC: | cem |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Alex Richardson
2018-10-30 21:32:43 UTC
Seems like a good idea to me. On my local amd64 kernels, I see SYMTAB in the stripped binary (objdump -x) and not in the corresponding .debug file in /usr/lib/debug. (Conditional on MK_DEBUG_FILES, bsd.lib.mk splits full objects, including kernels, into stripped and debuginfo with: 296 ${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug 297 ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ 298 ${SHLIB_NAME_FULL} ${.TARGET} ... 303 ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} 304 ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} Apparently --strip-debug leaves SYMTAB if one was present.) A related but tangential is GNU hash support for symbol lookup by name and/or linking. amd64 .ko's are weird and not "finished" objects, so binutils doesn't generate a ".gnu.hash" section for them, but there's no reason we couldn't do so in elftoolchain or some trivial build tool. |