Update thunk range error report for PPC64PCRelLongBranchThunk after re-basing the branch with https://reviews.llvm.org/D87486
Add a range error test for PPC64R12SetupStub
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lld/ELF/Thunks.cpp | ||
---|---|---|
913 | We have an existing diagnostic like error: relocation R_AARCH64_ABS32 cannot be used against symbol hidden; recompile with -fPIC |
lld/ELF/Thunks.cpp | ||
---|---|---|
913 | Just want to clarify, are you suggesting to follow the same error message print format as error: relocation R_AARCH64_ABS32 cannot be used against symbol hidden; recompile with -fPIC ? | |
lld/test/ELF/ppc64-pcrel-call-to-extern-error.s | ||
1 ↗ | (On Diff #290739) | We want to keep the linux to run the test on ppc-linux only since writing to an allocated file will cause time error for this case on freebsd bots. Will add some comments in the tests |
9 ↗ | (On Diff #290739) | Will do. |
Addressed review comments to
- Change the error message
- Change the LIT test accordingly
lld/ELF/Thunks.cpp | ||
---|---|---|
913 | Thanks. Based on Sean's comment in https://reviews.llvm.org/D86706, I would change the second sentence to "; recompile using the large code model". |
This LGTM but of course, wait to hear from @MaskRay because he had test case concerns.
lld/test/ELF/ppc64-pcrel-call-to-toc-error.s | ||
---|---|---|
1 | It appears that the file systems on FreeBSD and Linux behave differently. On Linux, writing the large file (8GB in this case) happens in a fraction of a second which suggests that it is not actually writing the bytes to storage. However, on FreeBSD this takes a significant amount of time - perhaps it is actually writing the bytes to storage. So we limit these test cases that produce large files to Linux to avoid this problem. The issue can be avoided on FreeBSD by writing out to /dev/null or some other special file because that won't mmap - it creates a memory buffer. However, that causes a different problem on systems that limit virtual memory - the OS won't allow the process to allocate a memory buffer that size. So the easiest solution we found was to write to a real file and limit this to Linux. |
lld/test/ELF/ppc64-pcrel-call-to-toc-error.s | ||
---|---|---|
26 | I could remove them but it would be better to keep them because the asm doesn't really make sense for a toc-based callee without the toc setup. Of course, I can remove them if you insist. |
lld/test/ELF/ppc64-pcrel-call-to-toc-error.s | ||
---|---|---|
1 | Thanks for the thorough explanation. |
lld/test/ELF/ppc64-pcrel-call-to-toc-error.s | ||
---|---|---|
1 | In this case, PHDRS and :segment should be specified to assign sections to different text segments. |
lld/test/ELF/ppc64-pcrel-call-to-toc-error.s | ||
---|---|---|
1 | This is outside my wheelhouse, so I have to ask for clarification: The test can use PHDRS command to create multiple small load segments, then in the SECTIONS command we would have 2 lines like: .output_section_name { input_sections_to_match } : load_segment_name The first to match callers section, then increase the address sufficiently far away and have a second similar line for the callees section? |
lld/test/ELF/ppc64-pcrel-call-to-toc-error.s | ||
---|---|---|
1 | Nice, thanks! |
We have an existing diagnostic like
error: relocation R_AARCH64_ABS32 cannot be used against symbol hidden; recompile with -fPIC