[Bug debugedit/33789] debugedit corrupts RISC-V object files

mark at klomp dot org sourceware-bugzilla@sourceware.org
Wed Jan 14 12:37:33 GMT 2026


https://sourceware.org/bugzilla/show_bug.cgi?id=33789

--- Comment #10 from Mark Wielaard <mark at klomp dot org> ---
(In reply to Jason Montleon from comment #9)
> Perhaps this has to do with what is discussed here?
> "Why is .symtab so huge on riscv?"
> https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1036

O, yes. That does explain things. Thanks.
And the corresponding GCC bug has been closed.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107251
So for now we are stuck with it, it seems :{

There is way too much information about riscv linker relaxation here:
https://maskray.me/blog/2021-03-14-the-dark-side-of-riscv-linker-relaxation

I still think this doesn't make sense for cross (non-allocated) debug section
references. Especially if the target reference is an index in a string table
section.
It might make sense to somehow special case those, because the debug string
tables can be huge so the overhead of having one extra symbol per string is
also huge.

But for now it seems we have to deal with it. And it explains why this is only
a bug on riscv when dealing with debuginfo in ET_REL files (objects, static
archives and kernel modules).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Debugedit mailing list