linuxppc / issues

Issues repository for linuxppc
5 stars 0 forks source link

Toolchain issues with pcrel addressing #455

Open npiggin opened 1 year ago

npiggin commented 1 year ago

This issue will track some issues with porting the 64-bit kernel to pcrel addressing. Once we have something reasonably working and found no good way to solve these, they should be raised with relevant toolchain projects.

npiggin commented 1 year ago
npiggin commented 1 year ago
peter-bergner commented 1 year ago

r2 is unused in pcrel code. Could we have an option to permit the compiler to use it?

The ELFv2 ABI updated for PCREL defines r2 to be a volatile register when generating PCREL code. I've tasked one of our GCC developers to enable using r2 when we're generating code for pcrel. No additional compiler option will be required, other than -mcpu=power10 (or -mpcrel) to enable pcrel code generation.