-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLD] Support --enable-long-section-names
#56
Comments
Right, I do remember looking at this detail and discussing it with someone. FWIW, LLD has got slightly different logic for short/truncated vs long section names. If linking stripped ( I do remember looking so far that the I guess I could hook up these options to further allow controlling the behaviour - or if there's opposition to that upstream, at least make them no-ops. |
FYI apparently Rust no longer emits |
Hm, from what I remember from discussing this with others, was that the I could still of course try to implement those options in lld, but it hasn't gotten to the top of the todo stack yet. |
I haven't found So far using LLD 9 from MSYS2 (coupled with GCC 9) was nice but when building
LLD supports |
The flag in question was removed recently indeed, in rust-lang/rust@d153f4f Longer section names are not used anymore, they were needed for the |
Yes, I've looked into version-script a couple times. Unfortunately, the existing code in LLD's ELF backend is very tightly entangled with the ELF linker. IIRC that parser is both used for the (fairly simple) version scripts and generic linker script (for controlling the output layout of the linker). Linker script in the COFF part of lld is pretty much "won'tfix", but I think it could be possible with a simpler standalone parser for version script for the COFF linker. For ELF, version scripts allows you to set different symbol versions to different symbols. Since PE/COFF doesn't have symbol versions, the only effect version scripts have there is to allow you to provide pattern matched lists of symbols to export/hide. What are the version scripts used for here? (I didn't invest enough time in trying to read the linked rust code right now...) In some cases I've seen, version scripts just exported the symbols As Rust does support linking with MS link.exe as well, which doesn't support version script, how is the same aspect handed there? Is it possible to somehow pick using that approach for mingw style linkers as well? |
I think their purpose is to distinguish local and global symbols.
I don't precisely know about all this stuff but IIUC for MSVC it just creates simple
I think it's possible to reuse this code for mingw nonetheless |
Sure - I meant does it use any fancy featuers like wildcards or so? But since it's only used for writing the same as can be written to def files, apparently not.
Ok, then that's probably the simplest path forward for making this work with lld.
Writing them is dead simple, but parsing them is a different matter, as the version scripts still have a not completely trivial syntax in the generic form. |
I'm out of time to do it soon but I should find time before the new year. Should we repurpose or close this issue? |
Maybe open another one; I might actually look at implementing some form of |
Oh sorry, I missed this question.
On the second thought there is no reason to open issue for |
Well, linker script in general is kinda won't fix. Version script is more of "I think it should be doable but I haven't had the direct need yet, it's always been possible to work around it pretty easily so far, but I would love to implement it at some point". Especially for codebases that work with MSVC, there's usually some other codepath available. |
I don't know if it's required for LLD (maybe stub would suffice) but Rust hardcodes this flag for compatibility with older LD versions
since it's MinGW target early days.
It could be possible to drop this flag by now but it'd require a lot of testing. Maybe it'd make sense for LLD to implement this flag (or stub) for feature parity with LD?
This blocks usage of Rust MinGW target with LLD.
The text was updated successfully, but these errors were encountered: