[LLVMdev] [PROPOSAL] ELF safe/unsafe sections

Rui Ueyama ruiu at google.com
Fri Jul 26 10:51:48 PDT 2013

I think it should also be enabled for -Os, as long as it always produces a
binary equivalent or smaller than one without the flags.

On Fri, Jul 26, 2013 at 10:43 AM, Shankar Easwaran
<shankare at codeaurora.org>wrote:

> On 7/26/2013 7:39 AM, Rafael EspĂ­ndola wrote:
>> On 25 July 2013 17:24, Rui Ueyama <ruiu at google.com> wrote:
>>> Then how about enable these flags for -O2? I want to hear from other
>>> people
>>> cc'ed, and I may be too cautious, but I'd hesitate to define a new ELF
>>> section if there's other mean already available to achieve the same
>>> thing.
>> I would probably support doing that first. A small annoyance is that
>> the linker requires the --gc-sections option, but most current gnu
>> (bfd and gold) versions support that, so we should be fine at least on
>> linux (and the driver already collects the distro we are in anyway in
>> case we need to change the default for some old distro).
>> Once that is in,  the existing proposals for splitting sections into
>> atoms become speed and relocatable object size optimizations.
> I partly agree. Implementing safe sections would be beneficial if you are
> getting third party libraries or system libraries(which are not usually
> compiled with -ffunction-sections and -fdata-sections).
> It would be nice to have -ffunction-sections and -fdata-sections the
> default at -O2. I am not sure why it was not made the default for all these
> years though.
> Thanks
> Shankar Easwaran
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted
> by the Linux Foundation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130726/51948510/attachment.html>

More information about the llvm-dev mailing list