[PATCH] [lld] [ELF] Fix linking when a regular object defines a symbol that is used in a DSO

Rui Ueyama ruiu at google.com
Mon Sep 22 12:08:21 PDT 2014


If the tool does not support that and if it would take time to add the
feature, it's OK to check in binary files for now.

But your patch does not contain the .so file because diff does not compare
binary files. Please send me the file so that I can submit.

On Mon, Sep 22, 2014 at 11:59 AM, Rafael Auler <rafaelauler at gmail.com>
wrote:

> Hi Rui,
>
> I updated the patch to use obj2yaml and yaml2obj to avoid binary files.
> While I was able to do this to the simple defobj.o file, I was not able to
> convert the YAML form of libundef2.so to a .so file. The error I got was:
>
> error: Unknown section referenced: '.dynsym' at YAML section '.hash'.
>
> Then I investigated my libundef2.so yaml representation and noticed that
> it was really missing .dymsym. I looked obj2yaml's source code and found
> this:
>
>   // Dump sections
>   for (const Elf_Shdr &Sec : Obj.sections()) {
>     switch (Sec.sh_type) {
>     case ELF::SHT_NULL:
>     case ELF::SHT_SYMTAB:
>     case ELF::SHT_DYNSYM:
>     case ELF::SHT_STRTAB:
>       // Do not dump these sections.
>
> ...which suggested that the tool currently does not support dumping the
> dynamic symbol table.
>
> Therefore, my new patch still depends on uploading the libundef2.so binary
> file. Is there any problem?
>
> Best regards,
> Rafael Auler
>
> http://reviews.llvm.org/D5424
>
> Files:
>   include/lld/ReaderWriter/ELFLinkingContext.h
>   lib/ReaderWriter/ELF/ELFLinkingContext.cpp
>   lib/ReaderWriter/ELF/OutputELFWriter.h
>   test/elf/Inputs/libundef2.so
>   test/elf/undef-from-dso-to-main.test
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140922/098cf057/attachment.html>


More information about the llvm-commits mailing list