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"
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 .text _start: call __start_foo call __stop_foo .section foo,"ax" nop
http://reviews.llvm.org/D13760
Implemented in r250432.