https://sourceware.org/bugzilla/show_bug.cgi?id=28789
Bug ID: 28789 Summary: RISC-V: ld resolves absolute symbols via PC-relative relocations for position-independent targets Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: palmer at gcc dot gnu.org Target Milestone: --- Created attachment 13911 --> https://sourceware.org/bugzilla/attachment.cgi?id=13911&action=edit First shot at a patch During a recent discussion on the psABI spec, it came up that we're allowing absolute symbols to be resolved via PC-relative addressing sequences when linked into position-independent targets. This may not produce the expected answer at runtime, which is not particularly friendly for users. I've attached a patch that resolves some of these issues, but see the big FIXME related to absolute symbols defined by linker scripts. I'm not sure what the expected behavior is there, but x86 is explicitly treating these as resolvable via PC-relative relocations and that's not what I'd expect so I'm assuming I'm missing something. Our GP initialization sequences are also using absolute addresses in this way, which is at best worrisome. Given how late we are in the 2.38 cycle and how tricky absolute symbols are, I think it's best if we hold off on doing anything for now. -- You are receiving this mail because: You are on the CC list for the bug.