llvm-project/llvm/test/MC
Fangrui Song 38426c114f [MC] Don't emit .symver redirected symbols to the symbol table
GNU as keeps the original symbol in the symbol table for defined @ and
@@, but suppresses it in other cases (@@@ or undefined). The original
symbol is usually undesired:
In a shared object, the original symbol can be localized with a version
script, but it is hard to remove/localize in an archive:

1) a post-processing step removes the undesired original symbol
2) consumers (executable) of the archive are built with the
   version script

Moreover, it can cause linker issues like binutils PR/18703 if the
original symbol name and the base name of the versioned symbol is the
same (both ld.bfd and gold have some code to work around defined @ and
@@). In lld, if it sees f and f@v1:

  --version-script =(printf 'v1 {};') => f and f@v1
  --version-script =(printf 'v1 { f; };') => f@v1 and f@@v1

It can be argued that @@@ added on 2000-11-13 corrected the @ and @@ mistake.

This patch catches some more multiple version errors (defined @ and @@),
and consistently suppress the original symbol. This addresses all the
problems listed above.

If the user wants other aliases to the versioned symbol, they can copy
the original symbol to other symbol names with .set directive, e.g.

    .symver f, f@v1  # emit f@v1 but not f into .symtab
    .set f_impl, f   # emit f_impl into .symtab

llvm-svn: 369233
2019-08-19 06:17:30 +00:00
..
AArch64 [AArch64] Add support for Transactional Memory Extension (TME) 2019-07-31 12:52:17 +00:00
AMDGPU [AMDGPU][MC][GFX10] Enabled GFX10 assembly with arbitrary wavesize assumed by the code 2019-07-24 16:50:17 +00:00
ARM [MC] Don't emit .symver redirected symbols to the symbol table 2019-08-19 06:17:30 +00:00
AVR [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
AsmParser Fix a crash with assembler source and -g. 2019-06-21 13:10:19 +00:00
BPF [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
COFF Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability 2019-08-05 14:16:58 +00:00
Disassembler Re-commit: [AMDGPU] Use S_DENORM_MODE for gfx10 2019-08-06 02:16:11 +00:00
ELF [MC] Don't emit .symver redirected symbols to the symbol table 2019-08-19 06:17:30 +00:00
Hexagon [llvm-mc] Add reportWarning() to MCContext 2019-08-08 19:13:23 +00:00
Lanai [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
MSP430 [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
MachO [llvm-readobj][MachO] Fix section type printing 2019-08-15 07:22:04 +00:00
Mips [Mips] Instruction `sc` now accepts symbol as an argument 2019-08-07 12:21:26 +00:00
PowerPC [MC] Don't emit .symver redirected symbols to the symbol table 2019-08-19 06:17:30 +00:00
RISCV [RISCV] Allow parsing of bare symbols with offsets 2019-08-16 12:00:56 +00:00
Sparc [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
SystemZ [SystemZ] Add support for new cpu architecture - arch13 2019-07-12 18:13:16 +00:00
WebAssembly [WebAssembly] Assembler/InstPrinter: support call_indirect type index. 2019-08-01 18:08:26 +00:00
X86 [llvm-readobj][MachO] Fix section type printing 2019-08-15 07:22:04 +00:00