[PATCH] D30291: Handle section header flags redefinitions similar to GAS

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 10:03:20 PST 2017


Christof Douma <Christof.Douma at arm.com> writes:

> Hi Rafael.
>
> Thanks for your comments. I’ve answered inline below.
> B.T.W. It seems emails are not showing up in phabricator.

Yes, phab eats some comments :-(


> The code that controls this is at [1]. It diagnoses flag overrides for some libbfd specific macro’s, but it accepts the rest. From the comment in the else clause there and some chats with engineers that worked on GAS I believe the argument in GAS is that MASKPROC and MASKOS are special because they are target-specific flags in the ELF standard, while the other are all defined there.

But that seems an argument for producing an error, no? When we don't
what the flags are, we have to be conservative and assume they conflict.

>
> +// Test we handle overriding OS and PROC specific flags on the builtin .text section
> +.section .text,"0x200006",%progbits
> +.section .text,"0x40000006",%progbits
>
>
> The distinction of builtin versus regular is also odd. The ELF spec has
> no such terms.
>
> It is not the ELF spec that I refer to. It is LLVM that has some pre-constructred sections (see: MCObjectFileInfo::initELFMCObjectFileInfo()). For example: the “.text” section exists before even using any directive . I wanted to cover that in this test too.

Sure, but why is that special? If I remember correctly gas always creates
a .bss too. Should that be special? Is there any reason for it?

Cheers,
Rafael


More information about the llvm-commits mailing list