In my experimentation with link.exe from both VS 2015 and 2017, it
always produces images with truncated section names. Update the comment
accordingly.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I'm putting this up for review mostly so that someone else can also confirm that link.exe always truncates section names.
I think what the original comment was trying to say is, emitting preserving a long section name (by emitting /<N> as the section name and put the real name at the N byte in the symbol table) would be useful for libunwind, though that's different from what we are doing now and what MSVC does.
IIRC the motivation for this change was actually the opposite. libunwind needed to determine the eh_frame section at runtime, but wasn't able to do so because of the string table not being loaded. @mstorsjo can confirm when he sees this though.
Ah, right. Looks like we can avoid confusion by not mentioning libunwind at all here. LGTM
Thank you for doing this.
LGTM. I confirmed this with link.exe with the test case from long-section-names.test. I don't remember what I originally tested, that the previous comment was based on - maybe it was just a mixup.
MSVC always truncates, but the BFD linker doesn't. The extra string table in the executable is their idea. The comments should reflect that.