crazy idea: Make all temporary symbols unnamed

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jun 17 11:49:43 PDT 2015


On 17 June 2015 at 13:34, Pete Cooper <peter_cooper at apple.com> wrote:
> BTW, MachO is already skipping non-linker visible symbols in all loops in computeSymbolTable.  So I think this is totally safe to do there.
>
> For example:
>
> for (const MCSymbol &Symbol : Asm.symbols()) {
>     if (!Asm.isSymbolLinkerVisible(Symbol))
>       continue;
>
>     StringTable.add(Symbol.getName());
>   }

But local symbols are visible to the linker if they are used in a relocation:

In

char *f(void) {
  return "foo" + 1;
}

We end up with


  0x7 1 2 1 X86_64_RELOC_SIGNED 0 L_.str

Cheers,
Rafael



More information about the llvm-commits mailing list