From: Sam Ravnborg <sam@ravnborg.org>
To: Christian Eggers <ceggers@arri.de>
Cc: barebox@lists.infradead.org, ceggers@gmx.de
Subject: Re: [PATCH] lds: Fix alignment of initcall table
Date: Fri, 17 Jan 2020 11:26:37 +0100 [thread overview]
Message-ID: <20200117102637.GA3698@ravnborg.org> (raw)
In-Reply-To: <20200117095013.31379-1-ceggers@arri.de>
Hi Christian.
Thanks for the patch.
On Fri, Jan 17, 2020 at 10:50:13AM +0100, Christian Eggers wrote:
> Depending on the preceding *(.rodata*) sections, the contents of the
> RO_DATA_SECTION macro may be unaligned.
>
> In my case, the initcall table was unaligned, because the preceding
> .rodata ended with the defaultenv when CONFIG_KALLSYMS was set to N.
>
> 0x00000000000b0a00 0x1c2 arch/arm/lib32/built-in.o
> .rodata.unwind_get_byte.str1.1
> 0x00000000000b0bc2 0x1e arch/arm/lib32/built-in.o
> .rodata.default_environment
> 0x00000000000b0be0 0x1d defaultenv/built-in.o
> .rodata.defaultenv_add_base.part.0.str1.1
> 0x00000000000b0bfd 0x35 defaultenv/built-in.o
> .rodata.defaultenv_load.str1.1
> 0x00000000000b0c32 0x2b defaultenv/built-in.o
> 0x36 (size before relaxing)
> 0x00000000000b0c5d <--- oops
> __barebox_initcalls_start = .
> *(.initcall.0)
>
> Tested on i.MX6 (ARM v7).
>
> Fixes: c5d38e9201 ("lds: Add and use RO_DATA_SECTION macro")
> Signed-off-by: Christian Eggers <ceggers@arri.de>
Have you seen:
d5f8bd9c503e0a17ef071eec50c537cc82a7956c ("lds: align RO_DATA_SECTION members")
which was recently committed to master?
It looks like the two patches fixes the same.
Expect that you have much higher alignment demands in a few cases (ia32, x86).
Could you verify if things works on latest master or you still need
additional alignment?
Thanks,
Sam
> +++ b/arch/x86/mach-efi/elf_ia32_efi.lds.S
> @@ -35,6 +35,7 @@ SECTIONS
>
> .data : {
> *(.rodata*)
> + . = ALIGN(4096);
> RO_DATA_SECTION
> *(.data)
> *(.data1)
> diff --git a/arch/x86/mach-efi/elf_x86_64_efi.lds.S b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
> index 40a942503..0d42e6ddd 100644
> --- a/arch/x86/mach-efi/elf_x86_64_efi.lds.S
> +++ b/arch/x86/mach-efi/elf_x86_64_efi.lds.S
> @@ -38,6 +38,7 @@ SECTIONS
>
> .data : {
> *(.rodata*)
> + . = ALIGN(4096);
> RO_DATA_SECTION
> *(.got.plt)
> *(.got)
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2020-01-17 10:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 9:50 Christian Eggers
2020-01-17 10:26 ` Sam Ravnborg [this message]
2020-01-17 11:12 ` Christian Eggers
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=20200117102637.GA3698@ravnborg.org \
--to=sam@ravnborg.org \
--cc=barebox@lists.infradead.org \
--cc=ceggers@arri.de \
--cc=ceggers@gmx.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