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

Rafael Auler rafaelauler at gmail.com
Mon Sep 22 11:59:51 PDT 2014


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 --------------
A non-text attachment was scrubbed...
Name: D5424.13944.patch
Type: text/x-patch
Size: 4695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140922/d7717972/attachment.bin>


More information about the llvm-commits mailing list