This allows relaxing some relocations to symbol+offset instead of emitting
a relocation against a symbol.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This allows relaxing some relocations to symbol+offset instead of emitting
a relocation against a symbol.
STT_SECTION symbol+offset
Comment Actions
This is causing linker failures in Android Chromium builds: https://crbug.com/1354305
Sample output:
[484/106609] LINK ./test_mixed_component_demo FAILED: test_mixed_component_demo exe.unstripped/test_mixed_component_demo exe.unstripped/test_mixed_component_demo.map.gz python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./test_mixed_component_demo" --strip="../../third_party/llvm-build/Release+Asserts/bin/llvm-strip" --unstripped-file="./exe.unstripped/test_mixed_component_demo" --map-file "./exe.unstripped/test_mixed_component_demo.map.gz" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -Werror -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -flto=thin -Wl,--thinlto-jobs=all -Wl,--thinlto-cache-dir=thinlto-cache -Wl,--thinlto-cache-policy=cache_size=10\%:cache_size_bytes=40g:cache_size_files=100000 -Wl,-mllvm,-import-instr-limit=5 -march=armv7-a -Wl,--no-rosegment -Wl,--no-call-graph-profile-sort -Wl,--exclude-libs=libvpx_assembly_arm.a --unwindlib=none --target=arm-linux-androideabi23 -no-canonical-prefixes -Wl,--warn-shared-textrel -Wl,-O2 -Wl,--gc-sections -Wl,-z,defs -Wl,--as-needed -nostdlib++ --sysroot=../../third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot -Wl,--warn-shared-textrel -Wl,--lto-O0 -pie -Bdynamic -Wl,-z,nocopyreloc -o "./exe.unstripped/test_mixed_component_demo" -Wl,--start-group @"./test_mixed_component_demo.rsp" -Wl,--end-group -landroid_support -ldl -lm ld.lld: error: thinlto-cache/llvmcache-CFD42F77DBE4B29AA4645765DE7225F761BBE9DD:(function _Unwind_VRS_Pop: .text.unlikely._Unwind_VRS_Pop+0xcc): branch and link relocation: R_ARM_THM_CALL to non STT_FUNC symbol: .L_Unwind_VRS_Set$local interworking not performed; consider using directive '.type .L_Unwind_VRS_Set$local, %function' to give symbol type STT_FUNC if interworking between ARM and Thumb is required; Unwind-EHABI.cpp:1120 (../../buildtools/third_party/libunwind/trunk/src/Unwind-EHABI.cpp:1120) clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment Actions
Repro made with -Wl,--reproduce=repro.tar: https://drive.google.com/file/d/1pgQI2adwx3DJJqIYvMY4i249ouHU0rmu/view?usp=sharing
Comment Actions
Thanks for the reproducer. However, to confirm I'd a minimal set of source files since the archive of already has the bad symbol table encoded.
I believe this should be fixed by D131429. I will rebase that and adjust the test cases to allow these two patches to be committed in the inverse order.