
Dear David,
In message 0579E649-F359-415B-A8ED-E1D4267F8A24@phytium.com.cn you wrote:
And if any text base alignment is less than the image's maximum alignment requirement, the load will fail, and then we likely scratch our heads and set the CONFIG_SYS_TEXT_BASE alignment higher until it works.
Whatever CONFIG_SYS_TEXT_BASE is the alignment will be ok if the relocated address satisfy the align requirement. So CONFIG_SYS_TEXT_BASE could be any value(compiler maybe require the text base aligned with 0x20), just make relocated address has the same offset.
There is a point which has not been answered yet, wnd which I really would like to understand. maybe you could be so kind and try to explain it to me?
I wonder if the use of the "ardp" instruction by the compiler can be influenced or maybe even prevent for specific code parts, for example by specific compiler options? For example, there is a number of PIC/PIE-related compiler options - would these have any influence here?
I wonder how "adrp" would work in any code that is supposed to be position-independent?
Best regards,
Wolfgang Denk