
Dear fenghua,
In message B9A956AA-4ED7-488D-B496-90111AA45A5A@phytium.com.cn you wrote:
We can not make gcc-aarch64 do not use adrp instruction when constructing address of label.
So, I think the 4kb alignment would be a requirement or restriction. Gcc did not declare it explicitly due to in normal world memory are allocated with page aligned. If u-boot for aarch64 want to be compiled at address not 4kb aligned the relocated address should also be shifted with the same offset.
Sorry, I don't understand anything here. At which exact place is there any such 4 k alignment restriction? When we relocate U-Boot, we just process a list of addresses. Even if the start of the image is aligned to a 4 k boundary, there are a zillion of other addresses that are not, and these can be relocated just fine.
So why exactly would there be such a restriction on the start address of the image? Note especially, that the start address of the image is just where the text segment starts - it is not necessarily the entry point address where code execution begines.
Best regards,
Wolfgang Denk