-
Notifications
You must be signed in to change notification settings - Fork 67
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
Enable building with lld #75
base: master
Are you sure you want to change the base?
Conversation
Could you rebase this and have a look into the CI issues. Unfortunately, the logs have been deleted, so I can't see why RV32 complains about. |
Lost track of this PR, I have now rebased and made a minor change not to fail on GCC versions that don't support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the typo's in the commit message ("sack", should be copies to the stack), it looks fine to me now.
PT_PHDR is emitted by ld.lld but not ld.bfd. This segment should only exist if the program header *is* part of the program memory image itself (which is not the case in seL4, as it copies the program header in the stack). This is important as muslc’s TLS init is relying on the existence of PT_PHDR to get the base address of the image in memory and from that, it calculates the TLS base for the source ELF. The calculation will be wrong in seL4 as the program header is copied in the stack; thus it may trigger a page fault if the new TLS base is not mapped, or affects the integrity of programs relying on TLS variables (e.g., those with __thread). By setting PT_PHDR's segment to PT_NULL, muslc will skip this search and won't do any relocations for the TLS segment which is part of the loaded ELF image itself, thus getting the correct mapped address. Sponsored by: DARPA. Signed-off-by: Hesham Almatary <[email protected]>
unused attribute does not prevent the sections from being garbage-collected during link-time optimisation. This may trigger undefined references errors to [__start|__stop]_test_case symbols that are expected to be emitted by the linker anyway. Adding "retain" attribute makes sure that the section and its associated symbols are kept regardless of linker's garbage collection. Another fix could be adding "nostart-stop-gc" to the linker flags, but since it is only one section (_test_case) where its __start/__stop symbols are references, adding retain to it makes more sense. This additional functionality requires binutils version 2.36 or later. Sponsored by: DARPA. Signed-off-by: Hesham Almatary <[email protected]>
No description provided.