* ELF section not represented in symbol table
@ 2021-10-11 19:09 Oleh Matiusha
0 siblings, 0 replies; only message in thread
From: Oleh Matiusha @ 2021-10-11 19:09 UTC (permalink / raw)
To: gcc-help
Hello GCC,
I am stuck debugging the compilation of my kernel module.
The files and copy-pasted description of this problem can be viewed here:
github.com/omatiusha/cdevmod .
My dir structure is following:
..
|-linux (here resides the source code for linux kernel
5.14.0-09718-g4b93c544e90e,
| built with GCC Ubuntu 9.3.0-17ubuntu1~20.04 + binutils 2.34)
|-linux-cross (here resides the source code for linux kernel
5.14.0-09718-g4b93c544e90e,
| built with x86_64-linux-gcc 8.5.0 + binutils 2.36.1
| from https://mirrors.edge.kernel.org/pub/tools/crosstool/).
| Tried also versions 9.4 and 11.1 from there.
|-extmodules - repo mentioned above.
I am trying to get my module working with kpatch (github.com/dynup/kpatch)
and get stuck debugging the compiler. To spot the place when everything
gets wrong, I compile this module independently four times, with host or
cross compiler, and patched or unpatched.
make KCFLAGS="-ffunction-sections -fdata-sections"
for host-compiler, and
CROSS_COMPILE=x86_64-linux- suffix=-cross make KCFLAGS="-ffunction-sections
-fdata-sections"
for cross-compiler. Then I dump symbols with objdump -t cdevmod.o and full
text with objdump -s cdevmod.o | grep PATCHED -C5. And notice that for a
host compiler, both sections .rodata.cdev_read.str1.1 and
.rodata.cdev_read.str1.8 are present in symbol table of patched version,
while for a cross compiler section .rodata.cdev_read.str1.1 is present as a
section, but absent in the symbol table. This causes kpatch utilities not
to work properly and crash.
I want the cross compiler to behave like host one. Please someone suggest
why it behaves differently.
Best regards,
Oleh Matiusha
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-11 19:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 19:09 ELF section not represented in symbol table Oleh Matiusha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).