Description
Context: As part of our work towards integrating lld into rustc (#36120), we found out
and reported 3 scenarios ("bugs") where lld
doesn't behave exactly the same as ld
. While one of
the LLD devs was looking over one of the object files that was used one of the bug reports, they
found out something that seemed irregular:
Quoting @rui314's comment from the LLVM bug tracker:
I sent out https://reviews.llvm.org/D24789 to fix the issue.
But I'm not completely sure if the object file created by rustc is valid. At least it seems to be causing a unnecessary trouble by choosing an irregular value for sh_entsize.
hello.o's .debug_gdb_scripts is a mergeable section with sh_entsize = 0. Usually the field is 1 for a section containing mergeable strings.
Jorge, I think you want to change rustc so that it sets 1 instead of 0.
The object mentioned in the comment can be generated with:
$ rustup default nightly-2016-09-15
$ echo 'fn main() { println!("Hello, world!"); }' > hello.rs
$ rustc -g hello.rs
This issue is to discuss if we should change the value of sh_entsize for this particular section.
This is above my paygrade so I'm going to cc @michaelwoerister who knows our debuginfo very well.
P.S. This particular bug has already been fixed in lld by, AIUI, relaxing one of their checks so our
object files are accepted.