[llvm-dev] clang assembler keeps .Linfo_string symbols?
Michael Johnson via llvm-dev
llvm-dev at lists.llvm.org
Wed May 3 10:16:03 PDT 2017
That was probably my fault - not sure of the niceties of the list. Also
not sure I understand why the integrated assembler behaves differently.
I guess gold is never used with object files produced this way?
Regards
Michael
> Tim Northover <t.p.northover at gmail.com> writes:
>
>> On 3 May 2017 at 08:01, Rafael Avila de Espindola via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>>> Can you provide a .s file that shows the difference?
>> I managed to reproduce it by compiling 'char *var = "whatever";' in
>> debug mode (so clang -target arm-none-eabi tmp.c -g"). Direct compile
>> leaves no assembler-local strings, but for some reason going via -S
>> does. I've not investigated further I'm afraid.
> Sorry, had somehow replied off list:
>
> This reduces to
>
> .section .debug_str,"MS",%progbits,1
> .Linfo_string8:
> .long .Linfo_string8
>
> the difference comes from ELFObjectWriter::shouldRelocateWithSymbol. In
> particular
>
> // It looks like gold has a bug (http://sourceware.org/PR16794) and can
> // only handle section relocations to mergeable sections if using RELA.
> if (!hasRelocationAddend())
> return true;
>
> If I remove that we produce a relocation with the section, as does
> gas. The gold bug has not been fixed :-(
>
> Cheers,
> Rafael
>
More information about the llvm-dev
mailing list