r271211 - CodeGen: tweak CFConstantStrings for COFF and ELF

Rafael EspĂ­ndola via cfe-commits cfe-commits at lists.llvm.org
Mon May 30 16:54:46 PDT 2016


On 30 May 2016 at 16:48, Saleem Abdulrasool <compnerd at compnerd.org> wrote:
> On Mon, May 30, 2016 at 12:54 PM, Rafael EspĂ­ndola
> <rafael.espindola at gmail.com> wrote:
>>
>> Why .rodata.cfstring? Which linker treats that specially?
>
>
> Its mimicking the fact that the CF macros tried to place the structures in
> their own section.  This would technically allow a linker to coalesce the
> CFString structures (though, AFAIK, none do atm ... perhaps lld should be
> the first!).  In the worst case, this will just get collapsed into the
> .rodata section, so its no worse off.

BTW, if this is to be coalesced, I think the ELF way to do it would be
to mark the section SHF_MERGE and propose a new SHF_CFSTRING section
flag.

Cheers,
Rafael


More information about the cfe-commits mailing list