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
[elf2] implement __start_SECNAME and __stop_SECNAME #25562
Comments
It should be easy to implement that, but do you know any program that actually uses his feature? |
Ah, sorry, http://reviews.llvm.org/D13329 is the example as you wrote. I'll try to implement this. |
Do you know if Ian is referring to "input sections" or "output sections" when he says "sections"? |
It seems that "section name" means "output section name". I can link this code with gold, but if I rename input section "foo" to "bar" using linker script, it failed to link because __{start,stop}_foo no longer exist. .global _start .section foo,"ax" |
Implemented in r250432. |
Extended Description
This is required by D13329 (r250200).
In D13329, the following quote from Ian Taylor:
"When a section name is a valid C identifier, the linker automatically provides __start and __stop symbols set to the addresses of the beginning and end of the section. The symbols are __start_SECNAME and __stop_SECNAME where SECNAME is the name of the section.
This is not defined by the ELF ABI, but it is completely reliable on
GNU/Linux. In fact it is reliable on any ELF system except possibly
Solaris, and it probably works on Solaris too. This is definitely
what you should do instead of using a linker script. It's more
reliable and more efficient, and it's what everybody else does"
The text was updated successfully, but these errors were encountered: