Michael Johnson via llvm-dev
2017-May-03 17:16 UTC
[llvm-dev] clang assembler keeps .Linfo_string symbols?
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 >
Rafael Avila de Espindola via llvm-dev
2017-May-03 18:24 UTC
[llvm-dev] clang assembler keeps .Linfo_string symbols?
Michael Johnson <mpj at rowley.co.uk> writes:> 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?Good question. It is possible gas has a more targeted way of avoiding the gold bug, or they might not care about it. I would not be opposed to trying to remove the workaround to see how common the issue is these days. Cheers, Rafael
Michael Johnson via llvm-dev
2017-May-06 07:43 UTC
[llvm-dev] clang assembler keeps .Linfo_string symbols?
Hi Rafael, This probably doesn't help, but I wouldn't expect symbols starting with .L to appear in an object file (unless -L is supplied to the assembler). Regards Michael> Michael Johnson <mpj at rowley.co.uk> writes: > >> 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? > Good question. It is possible gas has a more targeted way of avoiding > the gold bug, or they might not care about it. > > I would not be opposed to trying to remove the workaround to see how > common the issue is these days. > > Cheers, > Rafael