[PATCH] D12874: [LLD/ELF2] Initial support for local symbols in symtab

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 05:21:39 PDT 2015


Please git-clang-format it.

The current behavior is equivalent to --discard-all. Please add that
option and use it in the existing tests.

For local.s, use FileCheck variables to check what Link points to or
just use "Link :". We test that in other tests already.

There is duplicated code between getNonLocalSymbols and
getLocalSymbols. Can you create a getSymbols(bool Local) helper?

This crashes trying to add local symbols to the dynamic symbol table:

$ cat t.s
        .global foo
foo:
bar:
$ clang -c t.s
$ ./build/bin/lld -flavor gnu2 t.o -o t.so -shared
lld: /home/espindola/llvm/llvm/include/llvm/MC/StringTableBuilder.h:54:
size_t llvm::StringTableBuilder::getOffset(llvm::StringRef) const:
Assertion `I != StringIndexMap.end() && "String is not in table!"'
failed.


   uint8_t *BufStart = Buf;

The name is not very appropriate anymore. It now points to the start
of the global symbols.

Cheers,
Rafael



On 15 September 2015 at 01:14, Davide Italiano <dccitaliano at gmail.com> wrote:
> davide created this revision.
> davide added reviewers: rafael, Bigcheese.
> davide added a subscriber: llvm-commits.
> davide set the repository for this revision to rL LLVM.
>
> Maybe this can be shrunk, and local.s needs some cleanup. Would appreciate comments, as I have other patches building on top of this one (I'll propose later if we're OK with the scaffolding).
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D12874
>
> Files:
>   ELF/InputFiles.cpp
>   ELF/InputFiles.h
>   ELF/Writer.cpp
>   test/elf2/basic64be.s
>   test/elf2/local.s
>   test/elf2/resolution.s
>


More information about the llvm-commits mailing list