llvm-project/llvm/test/tools/llvm-nm/X86/Inputs
Kevin Enderby df0d6dabb2 Change llvm-nm for Mach-O files to use dyld info in some cases when printing symbols.
In order to reduce swift binary sizes, Apple is now stripping swift symbols
from the nlist symbol table.  llvm-nm currently only looks at the nlist symbol
table and misses symbols that are present in dyld info.   This makes it hard to
know the set of symbols for a binary using just llvm-nm.  Unless you know to
run llvm-objdump -exports-trie that can output the exported symbols in the dyld
info from the export trie, which does so but in a different format.

Also moving forward the time may come a when a fully linked Mach-O file that
uses dyld will no longer have an nlist symbol table to avoid duplicating the
symbol information.

This change adds three flags to llvm-nm, -add-dyldinfo, -no-dyldinfo, and
-dyldinfo-only.

The first, -add-dyldinfo, has the same effect as when the new bit in the Mach-O
header, MH_NLIST_OUTOFSYNC_WITH_DYLDINFO, appears in a binary.  In that it
looks through the dyld info from the export trie and adds symbols to be printed
that are not already in its internal SymbolList variable.  The -no-dyldinfo
option turns this behavior off.

The -dyldinfo-only option only looks at the dyld information and recreates the
symbol table from the dyld info from the export trie and binding information.
As if it the Mach-O file had no nlist symbol table.

Also fixed a few bugs with Mach-O N_INDR symbols not correctly printing the
indirect name, or in the same format as the old nm-classic program.

rdar://32021551

llvm-svn: 305733
2017-06-19 19:38:22 +00:00
..
Strip-ST.dylib.macho-x86_64 Change llvm-nm for Mach-O files to use dyld info in some cases when printing symbols. 2017-06-19 19:38:22 +00:00
example.lib Print symbols from COFF import libraries. 2017-05-24 23:40:36 +00:00
hello.obj.elf-x86_64
hello.obj.macho-x86_64
init-fini.out.elf-x86_64 llvm-nm: Print correct symbol types for init and fini sections 2016-11-23 20:17:20 +00:00
libExample.a.macho-x86_64
test.IRobj-x86_64
weak.obj.elf-x86_64 llvm-nm: Don't print value or size for undefined or weak symbols 2016-11-23 20:17:15 +00:00