[PATCH] D137384: [MC][LoongArch] Fix needsRelocateWithSymbol() implementation

Youling Tang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 3 19:50:58 PDT 2022


tangyouling added a comment.

in LoongArch:

  $ readelf -Wr test.o 
  
  Relocation section '.rela.text' at offset 0x2a0 contains 5 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
  0000000000000010  0000000300000047 R_LARCH_PCALA_HI20     0000000000000000 .data + 0
  0000000000000014  0000000300000048 R_LARCH_PCALA_LO12     0000000000000000 .data + 0
  0000000000000018  0000000300000047 R_LARCH_PCALA_HI20     0000000000000000 .data + 4
  000000000000001c  0000000300000048 R_LARCH_PCALA_LO12     0000000000000000 .data + 4
  0000000000000028  0000000500000042 R_LARCH_B26            0000000000000000 .text.another + 0
  
  Relocation section '.rela.eh_frame' at offset 0x318 contains 2 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
  000000000000001c  0000000500000063 R_LARCH_32_PCREL       0000000000000000 .text.another + 0
  000000000000003c  0000000200000063 R_LARCH_32_PCREL       0000000000000000 .text + 0

in x86_64:

  $ readelf -Wr test_x86.o 
  
  Relocation section '.rela.text' at offset 0x1e8 contains 3 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
  0000000000000006  0000000300000002 R_X86_64_PC32          0000000000000000 .data + 0
  000000000000000c  0000000300000002 R_X86_64_PC32          0000000000000000 .data - 4
  0000000000000015  0000000400000002 R_X86_64_PC32          0000000000000000 .text.another - 4
  
  Relocation section '.rela.eh_frame' at offset 0x230 contains 2 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
  0000000000000020  0000000400000002 R_X86_64_PC32          0000000000000000 .text.another + 0
  0000000000000040  0000000200000002 R_X86_64_PC32          0000000000000000 .text + 0

in aarch64:

  $ aarch64-linux-gnu-readelf -Wr test_aarch64.o 
  
  Relocation section '.rela.text' at offset 0x2c8 contains 5 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
  0000000000000008  0000000300000113 R_AARCH64_ADR_PREL_PG_HI21 0000000000000000 .data + 0
  000000000000000c  0000000300000115 R_AARCH64_ADD_ABS_LO12_NC 0000000000000000 .data + 0
  0000000000000014  0000000300000113 R_AARCH64_ADR_PREL_PG_HI21 0000000000000000 .data + 4
  0000000000000018  0000000300000115 R_AARCH64_ADD_ABS_LO12_NC 0000000000000000 .data + 4
  0000000000000028  000000050000011b R_AARCH64_CALL26       0000000000000000 .text.another + 0
  
  Relocation section '.rela.eh_frame' at offset 0x340 contains 2 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
  000000000000001c  0000000500000105 R_AARCH64_PREL32       0000000000000000 .text.another + 0
  0000000000000034  0000000200000105 R_AARCH64_PREL32       0000000000000000 .text + 0

in RISCV:

  $ riscv64-linux-gnu-readelf -Wr test_riscv.o 
  
  Relocation section '.rela.text' at offset 0x2b0 contains 10 entries:
      Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
  0000000000000008  0000000800000017 R_RISCV_PCREL_HI20     0000000000000000 a + 0
  0000000000000008  0000000000000033 R_RISCV_RELAX                             0
  000000000000000c  0000000c00000018 R_RISCV_PCREL_LO12_I   0000000000000008 .L0  + 0
  000000000000000c  0000000000000033 R_RISCV_RELAX                             0
  0000000000000012  0000000900000017 R_RISCV_PCREL_HI20     0000000000000004 b + 0
  0000000000000012  0000000000000033 R_RISCV_RELAX                             0
  0000000000000016  0000000d00000018 R_RISCV_PCREL_LO12_I   0000000000000012 .L0  + 0
  0000000000000016  0000000000000033 R_RISCV_RELAX                             0
  0000000000000020  0000000600000012 R_RISCV_CALL           0000000000000000 test + 0
  0000000000000020  0000000000000033 R_RISCV_RELAX                             0
                             0


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137384



More information about the llvm-commits mailing list