-
Notifications
You must be signed in to change notification settings - Fork 513
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
understanding -PIE #369
Comments
The OpenSBI firmware binary is no less bare metal because it is a PIE. OpenSBI applies relocations to itself as part of its entry assembly code, so there is no external dependency to load the firmware. What problems do you experience when you don't patch OpenSBI? |
Actually my toolchain does not support PIE. I should figure out how to rebuild with PIE if needed. That would be ok. I appreciate the self relocation and I am a fan of flexibility. Just wondering if optional use of PIE (depending of toolchain capabilities) would be an option. For me there is two options fork and patch or find I way to achieve both in the main repo, without need to fork - which is my preferred option. Thats why I am trying to understand if PIE could be optional. (actually this is what I am doing) |
@SiFiveHolland Just wondering, if we could make the PIE option optional. So we could avoid forking the repo, as mentioned here. |
I think you just want to submit a patch to opensbi to make PIE an option, or even detect what the toolchain supports. The compile will need to specify FW_TEXT_START (or you could have a default of 0x80000000, like opensbi used to have) |
Were you unable to update your toolchain to support PIE? OpenSBI is not the only firmware to be compiled as a PIE. For example, U-Boot is as well. This seems to be a deficiency in your toolchain. |
I am using the standard toolchain of Zephyr OS. Same actually goes for all my other toolchains. Usually I don't need PIE. And actually the question is why should I enable PIE un the tool chain, although I don't need it. Additionally why is there the requirement to build openSBI with PIE although it seems to me there is no actual technical reason that really forces it. Instead it looks to me like it's optional - so why not making it optional then? If ok, I will prepare a PR for qemu builds without PIE option, where for other targets PIE will be enabled. Would that be acceptable? Side note, it would be a huge benefit, if openSBI could be built out-of-the-box for Zephyr. Because actually we want to use openSBI as per-se default for machine mode software and introduce supervisor mode based on that. |
just want to understand why
-PIE
is hard coded.if a bare metal build should be created, then this option prevents it.
thus shouldnt the
-PIE
option be optional?hints:
currently I always have to apply this patch: 2fe7528
The text was updated successfully, but these errors were encountered: