-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FDPIC/ePIC draft specification and work plan #429
base: master
Are you sure you want to change the base?
Conversation
|
||
NOTE: This style of function descriptor is used in specialized FDPIC ABIs for | ||
Blackfin, FR-V, SuperH, and Arm, and is part of the default ABI for PA-RISC, | ||
POWER (v1 only, has a third "static chain" field), and IA-64. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In PPC64 ELFv1, "static chain" is for dynamic linker's lazy binding. This is "environment pointer"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the two terms are interchangeable; they both go into r11 anyway. x86-64 also calls the register static chain.
In ePIC, `gp` is invariant and holds the GOT address for the process image at | ||
all instruction boundries. | ||
|
||
== Range extension thunks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to belong to another proposal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's another proposal to add it to the non-FDPIC ABI but it's considered an integral part of the FDPIC ABI.
|
||
=== riscv-toolchain-conventions | ||
|
||
Add -mfdpic option for FDPIC and -mepic option for ePIC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think -mepic in the previous proposal is in spirit identical to -msep-data (m68k, bfin) and -mno-pic-data-is-text-relative (arm).
-fPIE -mfdpic
with hidden visibility declarations can replace -fPIE -msep-data
, though setting the call-clobbered FDPIC register has slight overhead.
Do we want to introduce another option to avoid the minor FDPIC register overhead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're saving two memory accesses on a generic function call. It's probably close to -fomit-frame-pointer
in total.
Ping, @sorear do you have further update on this, or do you need some help on PoC implementation? |
This needs extensive editing to match the existing document, and I also haven't even started on prototype coding, but it's become clear the specification needs to exist somewhere other than my answers to questions on IRC so let's start a draft here.
I intend to create a second PR when I have something ready for formal review. Feel free to use this as a discussion thread for the high-level design.