Skip to content
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

ABI: Clarify if overlapping local functions are valid or prohibitted #139

Open
Alan-Jowett opened this issue May 11, 2024 · 1 comment
Open
Labels

Comments

@Alan-Jowett
Copy link

main:
  mov %r0, 1
  mov %r1, %r0
  call local func1
  mov %r1, %r0
  call local func2
func1:
  add %r0, 1
func2:
  add %r0, 1
  exit

There are three functions:
The main function, starting at PC 0 and ending at PC 7.
The first local function func1, starting at PC 5 and ending at PC 7.
The second local function func2, starting at PC 6 and ending at PC 7.

Is this valid? There doesn't appear to be anything in the ISA prohibiting it, but the Linux verifier rejects it.

@dthaler
Copy link
Collaborator

dthaler commented May 17, 2024

My view:
From the ISA perspective, there is nothing against it.
It would be up to the psABI (which specifies calling conventions for function calls), and the implementation.

@dthaler dthaler changed the title ISA: Clarify if overlapping local functions are valid or prohibitted psABI: Clarify if overlapping local functions are valid or prohibitted May 17, 2024
@dthaler dthaler added the ABI label May 17, 2024
@dthaler dthaler changed the title psABI: Clarify if overlapping local functions are valid or prohibitted ABI: Clarify if overlapping local functions are valid or prohibitted May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants