Support dead-stripping in ELF objects

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Apr 3 08:49:59 PDT 2013


On 2 April 2013 21:22, Robinson, Paul
<Paul_Robinson at playstation.sony.com> wrote:
> Nick, Shankar, and Jim all asked about some indication in the object
> file that .subsections_via_symbols is in effect and the relocs are right.
>
> The obvious place to put that indication is in the ELF header e_flags
> field, and that's what I do in my private target.  However, the e_flags
> field is specified to be processor-specific so it's kind of hard to
> pick a flag bit and be sure nobody uses it for something else anywhere,
> across all (ELF-using) targets.  I am willing to put out infrastructure
> to make it easy for any particular target to define a flag, but I am
> reluctant to say one-flag-fits-all.  (AFAICT, x86 and ARM don't define
> any, but MIPS and SPARC do [differently]. Haven't looked any further.)
> Not having one-flag-fits-all of course makes lld's life more complicated,
> if lld wants to take advantage of this stuff.
>

Using a "flag section" seems a popular way of specifying some
characteristic of the object file. See .note.GNU-stack for example.

> Thanks,
> --paulr

Cheers,
Rafael



More information about the llvm-commits mailing list