[PATCH] D34064: Allow the gas-style nonstandard SHT_GROUP section.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 13:06:24 PDT 2017


ruiu created this revision.
Herald added a subscriber: emaste.

The ELF standard defines that the SHT_GROUP section as follows:

- its sh_link has the symbol index, and
- the symbol name is used to uniquify section groups.

Some object files created by the GNU assembler don't seem to conform
to the standard. It looks like they have this additional rule:

- if the symbol has no name and a STT_SECTION symbol, a section name is used instead of a symbol name.

If we don't do anything for this, the linker fails with a mysterious
error message if input files are generated by gas. It is unfortunate
but I think we need to support it.


https://reviews.llvm.org/D34064

Files:
  lld/ELF/InputFiles.cpp
  lld/ELF/InputFiles.h
  lld/test/ELF/Inputs/sht-group-gas-compatibility.elf
  lld/test/ELF/sht-group-gas-compatibility.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34064.102069.patch
Type: text/x-patch
Size: 4946 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170609/b9ece801/attachment.bin>


More information about the llvm-commits mailing list