[all-commits] [llvm/llvm-project] adc55b: [X86] Avoid generating invalid R_X86_64_GOTPCRELX ...

Harald van Dijk via All-commits all-commits at lists.llvm.org
Fri Dec 18 15:44:16 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: adc55b5a5ae49f1fe3a04f7f79b1c08f508b4307
      https://github.com/llvm/llvm-project/commit/adc55b5a5ae49f1fe3a04f7f79b1c08f508b4307
  Author: Harald van Dijk <harald at gigawatt.nl>
  Date:   2020-12-18 (Fri, 18 Dec 2020)

  Changed paths:
    M lld/test/ELF/x86-64-gotpc-relax-nopic.s
    M llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
    R llvm/test/MC/ELF/got-relaxed-rex.s
    M llvm/test/MC/X86/gotpcrelx.s

  Log Message:
  -----------
  [X86] Avoid generating invalid R_X86_64_GOTPCRELX relocations

We need to make sure not to emit R_X86_64_GOTPCRELX relocations for
instructions that use a REX prefix. If a REX prefix is present, we need to
instead use a R_X86_64_REX_GOTPCRELX relocation. The existing logic for
CALL64m, JMP64m, etc. already handles this by checking the HasREX parameter
and using it to determine which relocation type to use. Do this for all
instructions that can use relaxed relocations.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D93561




More information about the All-commits mailing list