mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH v2] ARM64: reloc: fix relocation error for big fat bareboxes
Date: Wed, 15 May 2024 15:05:33 +0200	[thread overview]
Message-ID: <78496618-e2fa-4843-915c-16f61a9466f3@pengutronix.de> (raw)
In-Reply-To: <171575251342.1386613.8477114770061572436.b4-ty@pengutronix.de>

Hi,

On 15.05.24 07:55, Sascha Hauer wrote:
> 
> On Mon, 13 May 2024 16:01:21 +0200, Ahmad Fatoum wrote:
>> A multi_v8 barebox with KASAN enabled is 2051804 bytes even after
>> compression and this breaks linking for me:
>>
>>   arch/arm/cpu/common.o: in function `global_variable_offset':
>>   arch/arm/include/asm/reloc.h:20:(.text.relocate_to_current_adr+0x1c):
>>     relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against symbol
>>     `_text' defined in .text section in .tmp_barebox1
>>   arch/arm/include/asm/reloc.h:20:(.text.relocate_to_current_adr+0x40):
>>     relocation truncated to fit: R_AARCH64_ADR_PREL_LO21 against symbol
>>     `_text' defined in .text section in .tmp_barebox1
>>
>> [...]
> 
> Applied, thanks!

Thanks for applying. I thought some more about whether we should instead
have:

#ifdef __PBL__
        "adr    %0, _text\n"
#else
        /* (Decompressed) barebox proper should always be 4K aligned
         * so adrp here should be fine. PBL may also have adrp
         * references
         */
        "adrp   %0, _text\n"
        "add    %0, %0, :lo12:_text\n"
#endif

Otherwise, we require PBL to be placed 4K-aligned. Looking at GCC 13.2.1
output for an i.MX8M board, there are quite a lot of adrp references already,
so I think this shouldn't break anything that's not broken already anyway.

Just writing my thoughts for future reference.

Cheers,
Ahmad

> 
> [1/1] ARM64: reloc: fix relocation error for big fat bareboxes
>       https://git.pengutronix.de/cgit/barebox/commit/?id=9246c916a25a (link may not be stable)
> 
> Best regards,

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




      reply	other threads:[~2024-05-15 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 14:01 Ahmad Fatoum
2024-05-15  5:55 ` Sascha Hauer
2024-05-15 13:05   ` Ahmad Fatoum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78496618-e2fa-4843-915c-16f61a9466f3@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox