Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious failed to compute relocation: R_PPC64_REL64 in jl_DI_for_fptr #35460

Closed
vchuravy opened this issue Apr 13, 2020 · 6 comments
Closed
Labels
system:arm ARMv7 and AArch64 system:powerpc PowerPC

Comments

@vchuravy
Copy link
Member

Reproducer: https://gist.github.com/vchuravy/1e7b4d9fcca2f5faa0e1cd28480f6e54

Manifests itself as a scary:

  | | |_| | | | (_| |  |  Version 1.5.0-DEV.622 (2020-04-13)
 _/ |\__'_|_|_|\__'_|  |  vc/ppc_llvm9/88c5699df8 (fork: 1 commits, 0 days)
|__/                   |

julia> error()
ERROR: error: failed to compute relocation: R_PPC64_REL64, Invalid data was encountered while parsing the file
error: failed to compute relocation: R_PPC64_REL64, Invalid data was encountered while parsing the file
error: failed to compute relocation: R_PPC64_REL64, Invalid data was encountered while parsing the file

I think those were introduced in 4363c55 (cc: @vtjnash) since they are originating from https://github.com/llvm/llvm-project/blob/bb0e6cc1dd13997e59f3178e27b57f54c11f7f89/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp#L1798-L1804

x-ref: https://github.com/llvm/llvm-project/blob/e0fd87cc64d5102f20219b6bad0e337dc4e6b2d2/llvm/lib/Object/RelocationResolver.cpp#L130-L138

cc: @shirodkara

@vchuravy vchuravy added the system:powerpc PowerPC label Apr 13, 2020
@vtjnash
Copy link
Member

vtjnash commented Apr 14, 2020

Like the commit message said, I had to change that because LLVM added assertions to prevent us from using the better fast path.

@yuyichao
Copy link
Contributor

yuyichao commented Jul 14, 2020

https://reviews.llvm.org/D83800 (I'll leave the honor of carrying this patch to someone else since I'm too lazy to track down all the places that needs to be updated, outside this repo...)

So after spending an hour trying to come up with a test case I realized that this case is not actually used in llvm-dwarfdump and seems also not in any other cli tools... So it would have been fine if llvm was lazier......

@vchuravy
Copy link
Member Author

Yeah I can add it to JuliaPackaging/Yggdrasil#1301

@yuyichao
Copy link
Contributor

I can confirm that the issue on aarch64 is fixed for me with the patch.

@MaskRay
Copy link
Contributor

MaskRay commented Jul 18, 2020

You may need llvm/llvm-project@e0fd87c (llvm-dwarfdump errors -> warnings)

llvm/llvm-project@b922004 added support for R_PPC_REL32 & R_PPC64_REL{32,64}

A larger issue is that llvm-dwarfdump on an object file does not do some linker job so that reasonable addresses are reported.

@vchuravy
Copy link
Member Author

Thanks @MaskRay!

@vchuravy vchuravy closed this as completed Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:arm ARMv7 and AArch64 system:powerpc PowerPC
Projects
None yet
Development

No branches or pull requests

4 participants