Comments (8)
The 2019Q4 release (published in January 2020) has information on the use of r11 and the frame chain. There is a link in the change history to the new sections. I'm not aware of any further unpublished changes.
from abi-aa.
on the use of r11 and the frame chain.
Right, but what about r7/THUMB2?
Historically the frame pointer in Thumb has not been defined in the
AAPCS with implementations falling back to historic definitions of
fp = r7 in Thumb and fp = r11 in Arm.
But now were adding changes to LLVM to warn/error on the use of r7 in THUMB when frame pointers are not omitted, ex:
But the official documents from ARM don't document this relationship at all.
I'm not aware of any further unpublished changes.
Ah, got it, so I misunderstood your LKML post. I had assumed this was addressed in an unpublished version. So I should change the request to: "please specify or formalize the relationship of r7 as the frame pointer in thumb."
from abi-aa.
I think the idea is that we want to formalize the frame pointer as r11 going forward.
Prior to the most recent AAPCS the frame pointer register was unspecified and different compilers did different things:
gcc and clang use r7 for Thumb and Thumb2, r11 for Arm
armcc (Arm's proprietary/legacy compiler) used r11 if Thumb2 was available r7 if only Thumb, r11 for Arm.
In a future version of gcc and clang implements r11 as the frame pointer and the errors for using r7 can go away as it will no longer be the frame-pointer.
The place for documenting the current use of r7 as the frame-pointer would be the GCC and Clang documentation as prior to the recent ABI update it was implementation defined.
prior to the most recent AAPCS there was no
from abi-aa.
My understanding of the
AAPCS is that it has been changed to make the frame pointer r11 on
both Arm and Thumb to make unwinding possible
it is likely some platforms will want to persist
with r7.
oh, sorry, so I misunderstand yet again. r7 is the "legacy frame pointer" and r11 is the "new" frame pointer on thumb?
I see in LLVM getFramePointerReg
can return r7 or r11...based on
bool useR7AsFramePointer() const {
return isTargetDarwin() || (!isTargetWindows() && isThumb());
}
from abi-aa.
Yes, that's correct. I'm not sure what returning r11 on a target without Thumb 2 would do (not a problem for Darwin and Windows). With luck it would just work, but would need to do some testing.
from abi-aa.
So that logic in LLVM looks wrong then to me (or at least out dated in terms of changes to AAPCS). What's the plan for changing that logic?
from abi-aa.
Yeah, Apple still uses r7 as the frame pointer. The main affected platform is 32-bit watches, which are still in circulation.
That ABI is AAPCS-based, but not exactly the same (stack alignment is 16 bytes for example). I don't think we plan to change any of that, and if we've already got divergence from AAPCS one more change doesn't really matter anyway.
from abi-aa.
I'll need to check with @kbeyls and the internal engineering teams at Arm with respect to changing to r11 in clang and gcc, obviously we'll need to preserve other platforms choices.
from abi-aa.
Related Issues (20)
- [sysvabi64] document requirement for bti c in more detail HOT 1
- [aaelf64] BTI PLT requirement should be weaker HOT 2
- Is page-size part of the ABI ? HOT 1
- [sysvabi64] Optional `add x16, x16, :lo12: &.got.plt[N]]` for `ld -z now` HOT 5
- Clarify definition of HFA in AAPCS64 HOT 8
- RST code blocks of type "none" cause warnings when generating html
- Word wrap in RST source files is inconsistent
- PAuthABI support for DWARF (Debugging and Unwinding)
- Reserve DT_ tags used in the PAuthABI and MemtagABI.
- static linkers (lld and GNU ld) out of sync with aaelf64 for GOT relocations with addends. HOT 1
- Need dynamic tag to reflect .note.gnu.prop and/or .note.AARCH64-PAUTH-ABI-tag section addresses HOT 3
- Define GOT-Relative data relocation HOT 3
- Undefined weak symbol's address HOT 8
- Missing page "Semihosting for AArch32 and AArch64" HOT 4
- [pauthabielf64] Define `NT_ARM_TYPE_PAUTH_ABI_TAG` constant
- Some documents have stopped rendering in the preview mode in the Github UI HOT 3
- aaelf64/aaelf64.rst can't preview HOT 2
- Clarify use of DWARF versions
- Quantifying the benefits of DT_AARCH64_AUTH_RELR HOT 5
- [PAUTHABIELF64] Possible typo in `R_AARCH64_AUTH_GOT_LO12_NC` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abi-aa.