[libc-commits] [PATCH] D151539: [libc] Initiliaze the global pointer in riscv startup code.

Jessica Clarke via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri May 26 01:16:00 PDT 2023


jrtc27 added a comment.

1. Why store in memory on the stack only to load it again?
2. Depending on how this is compiled it could use the GOT which isn't a good idea
3. Dollars in a C identifier sound like a bad idea
4. Relaxations need to be disabled for the address calculation specifically otherwise it will be relaxed to be GP-relative, which is clearly unhelpful

In short this really just needs to be done in assembly as the standard `.option push; .option norelax; lla gp, __global_pointer$; .option pop`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151539



More information about the libc-commits mailing list