[lld] r193556 - [PECOFF] Set section name for BSS atoms.

Shankar Easwaran shankare at codeaurora.org
Mon Oct 28 22:18:08 PDT 2013


On 10/29/2013 12:13 AM, Rui Ueyama wrote:
> On Mon, Oct 28, 2013 at 9:26 PM, Shankar Easwaran
> <shankare at codeaurora.org>wrote:
>
>> On 10/28/2013 11:20 PM, Rui Ueyama wrote:
>>
>>> On Mon, Oct 28, 2013 at 9:07 PM, Shankar Easwaran
>>> <shankare at codeaurora.org>**wrote:
>>>
>>>   On 10/28/2013 6:26 PM, Rui Ueyama wrote:
>>>>   -      : COFFDefinedFileAtom(file, name, "", scope, typeZeroFill, perms,
>>>>> +      : COFFDefinedFileAtom(file, name, ".bss", scope, typeZeroFill,
>>>>> perms,
>>>>>
>>>>>   The section name should be derived by the writer for default section
>>>> types.
>>>>
>>>>   That is not true for COFF. In COFF, section name has significance unlike
>>> ELF, and the linker is expected to emit sections with the same name as in
>>> the object file.
>>>
>> ELF goes by section names too. What I am trying to say here is if the
>> atoms contentType is typeZeroFill set the section name to .bss. Having a
>> section name as the default would only increase the native IR file size,
>> and increase in memory usage.
>>
> Well, there is an interesting feature in link.exe that you can rename or
> combine sections by /merge:*.from*=*.to*. And you can combine .bss to .data
> by /merge:.bss=.data. So it's better to set section name to BSS atoms.
That said, Linker scripts on ELF tries to attend to the same usecase. I 
am only nit picking because it would save memory / disk usage (native 
atoms).

Thanks

Shankar Easwaran



More information about the llvm-commits mailing list