public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/114060] New: asm constraints getting GOT address for ARM/FDPIC look wrong
@ 2024-02-22 18:32 bugdal at aerifal dot cx
  2024-02-22 18:59 ` [Bug libgcc/114060] " pinskia at gcc dot gnu.org
  2024-02-22 19:05 ` [Bug target/114060] " bugdal at aerifal dot cx
  0 siblings, 2 replies; 3+ messages in thread
From: bugdal at aerifal dot cx @ 2024-02-22 18:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114060

            Bug ID: 114060
           Summary: asm constraints getting GOT address for ARM/FDPIC look
                    wrong
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugdal at aerifal dot cx
  Target Milestone: ---

Reading the code added for unwind-pe.h for FDPIC, I came across the ARM
implementation that uses FDPIC_REGNUM as an input constraint to __asm to get
the GOT register value. As I understand it, this is not correct, as there is no
contract that this register permanently hold the GOT address for the executing
code; it's just a hidden argument register for making function calls, which the
callee can throw away if it does not need to access the GOT or any global data,
or spill and reload.

To reliably get the GOT register, I think you need to make an actual external
call to an asm function that movs the GOT register to the return-value register
and returns.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-22 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-22 18:32 [Bug libgcc/114060] New: asm constraints getting GOT address for ARM/FDPIC look wrong bugdal at aerifal dot cx
2024-02-22 18:59 ` [Bug libgcc/114060] " pinskia at gcc dot gnu.org
2024-02-22 19:05 ` [Bug target/114060] " bugdal at aerifal dot cx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).