[Bug,default/33869] abidiff broken output on arc/hexagon/mips64/ok1j/sh4 linux kernel headers
Commit Message
https://sourceware.org/bugzilla/show_bug.cgi?id=33869
Dodji Seketeli <dodji at seketeli dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2026-03-03
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #5 from Dodji Seketeli <dodji at seketeli dot org> ---
Ok, so after discussing this on IRC with Aaron Merey, Mark Wielaard and Arnd
Bergmann, here is my understanding of what is happening.
Aaron noted that when looking at the output of eu-readelf --debug-dump=info for
latest testcase for nios2 provided as attachment, it looks like all of
DW_AT_name using DW_FORM_strp resolves to the the "sys_vfork" string which is
at offset 0 in .debug_str.
binutils readelf however only references "sys_vfork" onces as the name of a
subprogram.
Aaron also noted that `eu-readelf -r xt_hashlimit-new.bin` lists all
.rela.debug_* relocation types as <INVALID RELOC> while binutils readelf lists
them all with known R_NIOS2_* types.
Mark noted that the R_NIOS2_* relocations are for the EM_ALTERA_NIOS2, aka
Altera Nios II. Sadly, elfutils just doesn't have a backend for that machine
yet. Which explains why all DW_FORM_strp resolve to offset 0, because
relocations aren't being applied for that unknown machine.
That problem is only for ET_REL binaries as ET_DYN binaries are relocated and
thus don't have the R_NIOS2_* relocations. Linux kernel binaries are
unfortunately ET_REL files.
Arnd would workaround his issue by locally and temporarily changing the
kernel's scripts/check-uapi.sh to make it build ET_DYN binaries:
One should thus file an enhancement request to elfutils to add a backend for
the EM_ALTERA_NIOS2 machine.
@@ -199,9 +199,10 @@ do_compile() {
local -r header="$2"
local -r out="$3"
printf "int main(void) { return 0; }\n" | \
- "$CC" -c \
+ "$CC" \
-o "$out" \
-x c \
+ -shared -fPIC -nostdlib \
-O0 \
-std=c90 \
-fno-eliminate-unused-debug-types \