Re: [PATCH 2/8] ARM: aarch64: Fix get_runtime_offset after relocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 22, 2019 at 5:52 AM Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> wrote:
>
> get_runtime_offset shall return the offset between the address we are
> running at and the address we are linked at. This value obviously
> changes when we relocate the binary. cf3b09737b tried to avoid using
> R_AARCH64_RELATIVE relocations, but in fact this is exactly what the
> function needs to work. Consider barebox starting at 0x10000000
> when we are linked at 0x0 then get_runtime_offset() should return
> 0x10000000 before relocate_to_current_adr(), but afterwards it should
> return 0x0.
>
> This patch brings back the previously removed "a" flag. Since gcc5
> doesn't put the values of R_AARCH64_RELATIVE fixup'd relocations
> into the binary but zeroes instead, we help ourselves by basing
> get_runtime_offset on an address which actually is zero. With
> CONFIG_RELOCATABLE=y the binary is always linked to 0x0, so _text
> is initially zero.
>

This paragraph might be worth putting in the comment as well to
document some cleverness that is still required to deal with GCC5.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux