aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2024-04-26 08:30:27 -0700
committerFangrui Song <i@maskray.me>2024-04-26 08:30:27 -0700
commitbf67610a8ac07ec143f243f129eecd456aa63383 (patch)
treee392ca341d19d67ea25f2c068565230daaec9397 /clang/lib/Frontend/InitPreprocessor.cpp
parent571831a680faa9615183f855fddf43fd1a9ba192 (diff)
downloadllvm-bf67610a8ac07ec143f243f129eecd456aa63383.zip
llvm-bf67610a8ac07ec143f243f129eecd456aa63383.tar.gz
llvm-bf67610a8ac07ec143f243f129eecd456aa63383.tar.bz2
[MC] Rename temporary symbols of empty name to ".L0 " (#89693)
Temporary symbols generated for .eh_frame and .debug_line have an empty name, which appear in .symtab in the presence of RISC-V style linker relaxation and will not be discarded by ld/objcopy --discard-locals (-X). In contrast, GNU assembler's riscv port assigns a fake name ".L0 " (with a trailing space) to these symbols so that will be discarded by ld/objcopy --discard-locals. This patch matches the GNU behavior. Since Clang's RISC-V targets pass -X to ld, and GNU ld defaults to -X for RISC-V targets, these ".L0 " symbols will be discarded after linking by default, as expected by users. The llvm-symbolizer special case for RISC-V `SF_FormatSpecific` symbols https://reviews.llvm.org/D98669 needs to be adjusted. Note: `"":` in assembly currently crashes. Note: bolt tests used /usr/bin/clang before llvmorg-19-init-9532-g59bfc3106874. The revert llvmorg-19-init-9531-g28b55342e1a8 actually broke bolt/test/RISCV/fake-label-no-entry.c
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions