[all-commits] [llvm/llvm-project] 340ba4: MIPS: fix emitDirectiveCpsetup on N32 (#80534)

YunQiang Su via All-commits all-commits at lists.llvm.org
Mon Mar 11 12:33:36 PDT 2024


  Branch: refs/heads/release/18.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 340ba4588c8073f97b03fd5da9a4fd5dc3b27d2e
      https://github.com/llvm/llvm-project/commit/340ba4588c8073f97b03fd5da9a4fd5dc3b27d2e
  Author: YunQiang Su <syq at debian.org>
  Date:   2024-03-11 (Mon, 11 Mar 2024)

  Changed paths:
    M llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
    M llvm/test/MC/Mips/cpsetup.s

  Log Message:
  -----------
  MIPS: fix emitDirectiveCpsetup on N32 (#80534)

In gas, .cpsetup may expand to one of two code sequences (one is related to `__gnu_local_gp`), depending on -mno-shared and -msym32.
Since Clang doesn't support -mno-shared or -msym32, .cpsetup expands to one code sequence.
The N32 condition incorrectly leads to the incorrect `__gnu_local_gp` code sequence.

```
00000000 <t1>:
   0:   ffbc0008        sd      gp,8(sp)
   4:   3c1c0000        lui     gp,0x0
                        4: R_MIPS_HI16  __gnu_local_gp
   8:   279c0000        addiu   gp,gp,0
                        8: R_MIPS_LO16  __gnu_local_gp
```

Fixes: #52785
(cherry picked from commit 860b6edfa9b344fbf8c500c17158c8212ea87d1c)



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