[lld] [lld][RISCV] More fine-grained __global_pointer$ placement (PR #182029)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 18 09:24:22 PST 2026


================
@@ -25,14 +25,12 @@
 # NOSDATA-NEXT: .data    PROGBITS [[#%x,DATA:]]
 # NOSDATA-NEXT: .bss     NOBITS   [[#%x,BSS:]]
 
-## If there is an undefined reference to __global_pointer$ but .sdata doesn't
-## exist, define __global_pointer$ and set its st_shndx arbitrarily to 1.
-## The symbol value should not be used by the program.
+## If .sdata doesn't exist but data exists, define __global_pointer$ at DATA_BEGIN+0x800
----------------
topperc wrote:

```suggestion
## If .sdata doesn't exist but .data exists, define __global_pointer$ at DATA_BEGIN+0x800
```

https://github.com/llvm/llvm-project/pull/182029


More information about the llvm-commits mailing list