[PATCH] D42475: [ELF] Add warnings for various symbols that cannot be ordered

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 06:08:56 PST 2018


jhenderson created this revision.
jhenderson added reviewers: ruiu, rafael, pcc.
Herald added subscribers: llvm-commits, emaste.

There are a number of different situations when symbols are requested to be ordered in the --symbol-ordering-file that cannot be ordered for some reason. To assist with identifying these symbols, and either tidying up the order file, or the inputs, a number of warnings have been added. As some users may find these warnings unhelpful, due to how they use the symbol ordering file, a switch has also been added to disable these warnings.

The cases where we now warn are:

1. Entries in the order file that don't correspond to any symbol in the input
2. Undefined symbols
3. Absolute symbols
4. Symbols imported from shared objects
5. Symbols that are discarded, due to e.g. --gc-sections

Note that we do not warn for symbols that are discarded because they are in a /DISCARD/ section in the linker script. This is because these warnings are emitted at the same time as the section order is calculated, which happens before the linker script commands are processed. As it is unlikely that /DISCARD/ sections are allocatable, and the symbol ordering is primarily used for such sections, this is not likely to be an issue.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D42475

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/InputSection.cpp
  ELF/InputSection.h
  ELF/LinkerScript.cpp
  ELF/Options.td
  ELF/Writer.cpp
  test/ELF/Inputs/symbol-ordering-file-warnings1.s
  test/ELF/Inputs/symbol-ordering-file-warnings2.s
  test/ELF/symbol-ordering-file-warnings.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42475.131243.patch
Type: text/x-patch
Size: 13255 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180124/5678a458/attachment.bin>


More information about the llvm-commits mailing list