[all-commits] [llvm/llvm-project] 3b6738: [MC][Mips] Generate required IMAGE_REL_MIPS_PAIR r...

Hervé Poussineau via All-commits all-commits at lists.llvm.org
Sun Jan 19 22:55:06 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b67383c6cb777e4f37dd1a5af0872843c9ab35a
      https://github.com/llvm/llvm-project/commit/3b67383c6cb777e4f37dd1a5af0872843c9ab35a
  Author: Hervé Poussineau <hpoussin at reactos.org>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M llvm/lib/MC/WinCOFFObjectWriter.cpp
    M llvm/test/MC/Mips/coff-relocs.ll

  Log Message:
  -----------
  [MC][Mips] Generate required IMAGE_REL_MIPS_PAIR relocation (#120876)

Add the required IMAGE_REL_MIPS_PAIR relocation after
IMAGE_REL_MIPS_REFHI/IMAGE_REL_MIPS_SECRELHI

Microsoft PE/COFF specification says that the IMAGE_REL_MIPS_REFHI
relocation contains "the high 16 bits of the target's 32-bit virtual
address. [...] This relocation must be immediately followed by a PAIR
relocation whose SymbolTableIndex contains a 16-bit displacement which
is added to the upper 16 bits taken from the location being relocated."

Microsoft PE/COFF specification says that the IMAGE_REL_MIPS_SECRELHI
relocation contains "the high 16 bits of the 32-bit offset of the target
from the beginning of its section. A PAIR relocation must immediately
follow this on. The SymbolTableIndex of the PAIR relocation contains a
16-bit displacement, which is added to the upper 16 bits taken from the
location being relocated."

Behavior has been checked against Microsoft C compiler for MIPS.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list