[lld] [lld][AArch64][ELF][PAC] Support `.relr.auth.dyn` section (PR #87635)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 15:51:02 PDT 2024
MaskRay wrote:
> We started seeing an lld relocation issue, and I bisected to this commit.
>
> ```
> [164519/322444](64) SOLINK arm64-shared/libmagma_shared.so
> FAILED: arm64-shared/libmagma_shared.so arm64-shared/lib.unstripped/libmagma_shared.so arm64-shared/libmagma_shared.so.build-id.stamp arm64-shared/libmagma_shared.ifs arm64-shared/link_stub/libmagma_shared.so
> mkdir -p arm64-shared/lib.unstripped && ../../prebuilt/third_party/clang/custom/bin/clang++ -shared -Wl,-soname="libmagma_shared.so" -Wl,--whole-archive arm64-shared/obj/src/graphics/lib/magma/src/libmagma/libmagma_client.a -Wl,--no-whole-archive -fcolor-diagnostics -Wl,--color-diagnostics -fcrash-diagnostics-dir=clang-crashreports -fcrash-diagnostics=all -gen-reproducer=error --sysroot=arm64-shared/gen/zircon/public/sysroot/cpp --target=aarch64-unknown-fuchsia -ffuchsia-api-level=4293918720 -march=armv8-a+simd+crc+crypto -mtune=generic -ffile-compilation-dir=. -no-canonical-prefixes -fomit-frame-pointer -fdata-sections -ffunction-sections -Wl,--gc-sections -Os -Wl,-O2 -flto -Wl,-mllvm,-wholeprogramdevirt-branch-funnel-threshold=0 -ffat-lto-objects -g3 -grecord-gcc-switches -gdwarf-5 -gz=zstd -fno-exceptions -fno-rtti -Wl,--icf=all -fPIC -Wl,--no-undefined -Lgen/zircon/system/ulib/c/c.aarch64 -L../../build/config/zircon/libc-dummy -o "arm64-shared/lib.unstripped/libmagma_shared.so" -Wl,--dependency-file="arm64-shared/libmagma_shared.so.d" -Wl,--Map="arm64-shared/lib.unstripped/libmagma_shared.so.map" "@arm64-shared/libmagma_shared.so.rsp" gen/zircon/system/ulib/c/c.aarch64/libc.so && ../../prebuilt/third_party/clang/custom/bin/llvm-objcopy --strip-all "arm64-shared/lib.unstripped/libmagma_shared.so" "arm64-shared/libmagma_shared.so" && ../../prebuilt/tools/buildidtool/linux-x64/buildidtool -build-id-dir .build-id -stamp "arm64-shared/libmagma_shared.so.build-id.stamp" -entry "=arm64-shared/libmagma_shared.so" -entry ".debug=arm64-shared/lib.unstripped/libmagma_shared.so" && ../../prebuilt/third_party/clang/custom/bin/llvm-ifs --write-if-changed --output-ifs=arm64-shared/libmagma_shared.ifs --output-elf=arm64-shared/link_stub/libmagma_shared.so arm64-shared/lib.unstripped/libmagma_shared.so
> ld.lld: error: arm64-shared/obj/src/graphics/lib/magma/src/libmagma/libmagma_client.a(magma_client.o): relocation section (index 44207) has invalid sh_info (0)
> clang++: error: ld.lld command failed with exit code 1 (use -v to see invocation)
> ```
>
> [luci-milo.appspot.com/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.arm64-release/b8746515880088952657/overview](https://luci-milo.appspot.com/ui/p/fuchsia/builders/ci/clang_toolchain.ci.core.arm64-release/b8746515880088952657/overview)
>
> This is just heads up, and I'll try to come up with a small reproducer. I'm just posting early in case you have any idea.
@gulfemsavrun With limited information, I suspect the root cause is something else. The lld error is to disallow a relocation section with an invalid target . You can run `llvm-readelf -S` on the relocatable file and figure out how it is built.
https://github.com/llvm/llvm-project/pull/87635
More information about the llvm-commits
mailing list