[lld] r241341 - [ELF] Define __start_XXX/__stop_XXX symbols where XXX is a section name

Simon Atanasyan simon at atanasyan.com
Fri Jul 3 05:16:36 PDT 2015


On Fri, Jul 3, 2015 at 3:00 PM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> On Fri, Jul 03, 2015 at 11:25:37AM -0000, Simon Atanasyan wrote:
>> This is GNU ELF linker extension used particularly by LibC code.
>> If input object files contain section named XXX, and the XXX is a valid C
>> identifier, and there are undefined or weak symbols __start_XXX/__stop_XXX,
>> linker should define __start_XXX/__stop_XXX symbols point to the begin/end
>> of the XXX section correspondingly.
>
> Why are they weak? Shouldn't they be hidden instead?

I follow the gnu linker. It does not make these symbols hidden.

$ gcc main.c -static
$ readelf -s a.out | grep __start_
  1283: 00000000004a0240     0 NOTYPE  GLOBAL DEFAULT  ABS __start___libc_atexit

-- 
Simon Atanasyan



More information about the llvm-commits mailing list