[PATCH] D81359: [ELF] Add --[no-]relax for RISC-V

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 02:08:35 PDT 2020


grimar added a comment.

In D81359#2089918 <https://reviews.llvm.org/D81359#2089918>, @MaskRay wrote:

> I have a use case for x86 R_X86_64_[REX_]GOTPCRELX when debugging a glibc static-pie issue.
>
> GNU ld --no-relax (loads an address from GOT):
>
>   // elf_get_dynamic_info called by dl-reloc-static-pie.c
>    316│ 176           if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)
>    317│    0x00007fefd511896e <+462>:   mov    0x695b(%rip),%rcx        # 0x7fefd511f2d0
>   ###### %rcx is 0 => null pointer dereference
>    318│    0x00007fefd5118975 <+469>:   testb  $0x40,(%rcx)
>


And this I think shows that supporting "--no-relax" for x86_64 can cause new bugs to appear. It is easy to avoid them by ignoring this option.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81359/new/

https://reviews.llvm.org/D81359





More information about the llvm-commits mailing list