Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCC's name for this symbol is _mcount, which the Linux kernel expects in a few different place: $ echo 'int main(void) { return 0; }' | riscv32-linux-gcc -c -pg -o tmp.o -x c - $ llvm-objdump -dr tmp.o | grep mcount 0000000c: R_RISCV_CALL _mcount $ echo 'int main(void) { return 0; }' | riscv64-linux-gcc -c -pg -o tmp.o -x c - $ llvm-objdump -dr tmp.o | grep mcount 000000000000000c: R_RISCV_CALL _mcount $ echo 'int main(void) { return 0; }' | clang -c -pg -o tmp.o --target=riscv32-linux-gnu -x c - $ llvm-objdump -dr tmp.o | grep mcount 0000000a: R_RISCV_CALL_PLT mcount $ echo 'int main(void) { return 0; }' | clang -c -pg -o tmp.o --target=riscv64-linux-gnu -x c - $ llvm-objdump -dr tmp.o | grep mcount 000000000000000a: R_RISCV_CALL_PLT mcount Set MCountName to "_mcount" in RISCVTargetInfo then prevent it from getting overridden in certain OSTargetInfo constructors. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D98881 Signed-off-by: Nathan Chancellor <nathan@kernel.org>
- Loading branch information