Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
Cc: Niklas Cassel <Niklas.Cassel@wdc.com>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Alistair Francis <alistair@alistair23.me>,
	"Yann E . MORIN" <yann.morin.1998@free.fr>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [PATCH v2 02/11] package: elf2flt: Update RISC-V 64-bits support
Date: Sat, 6 Aug 2022 22:47:50 +0200	[thread overview]
Message-ID: <20220806224750.62132558@windsurf> (raw)
In-Reply-To: <20220725164425.7316b2e3@windsurf>

Hello Damien, Hello Niklas,

Are there some updates on fixing the elf2flt segfault? It breaks some
of our defconfigs for other CPU architectures, so it cannot stay in
this situation :-/

Thanks for your contribution!

Thomas

On Mon, 25 Jul 2022 16:44:25 +0200
Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:

> Hello Damien, Hello Niklas,
> 
> On Mon, 30 May 2022 12:38:27 +0900
> Damien Le Moal via buildroot <buildroot@buildroot.org> wrote:
> 
> > From: Damien Le Moal <damien.lemoal@wdc.com>
> > 
> > Remove the old elf2flt 0002-elf2flt-add-riscv-64-bits-support.patch
> > patch file for riscv64 architecture and replace it with 3 patches:
> > 
> > (1) The first patch fixes the data section alignment
> > (2) The second patch fixes a bug with the handling of the eh_frame
> >     section causing text and data section overlap problems.
> > (3) The third patch adds a simpler riscv64 flat bin relocation support.
> > 
> > These 3 patches are submitted to the upstream elf2flt project as pull
> > request #22:
> > 
> > https://github.com/uclinux-dev/elf2flt/pull/22  
> 
> We are seeing an issue with this patch applied: it segfaults when
> linking binaries on the m68k architecture.
> 
> To be fully clear, when we use the current version of elf2flt in
> Buildroot (2021.02) + patch 0001-elf2flt-handle-binutils-2.34.patch +
> patch 0002-elf2flt.ld-reinstate-32-byte-alignment-for-.data-sec.patch,
> we have the following failure:
> 
>   /home/thomas/buildroot/outputs/m68k/host/m68k-buildroot-uclinux-uclibc/bin/elf2flt: ERROR: text=0x7db78 overlaps data=0x6b940 ?
> 
> which already existed *prior* to applying your patch.
> 
> However, as soon as we add
> 0003-elf2flt-fix-.eh_frame-section-handling.patch into the patch series
> applied to elf2flt, we get:
> 
>   ld (ld-elf2flt): /home/thomas/buildroot/outputs/m68k/host/m68k-buildroot-uclinux-uclibc/bin/elf2flt terminated with signal 11 [Segmentation fault], core dumped
> 
> Our friend gdb gives us some hint on where the segfault occurs:
> 
> #0  0x000055ebfc7524e0 in add_com_to_bss (bss_len=19112, number_of_symbols=3869, symbol_table=0x55ebfd601d50) at elf2flt.c:273
> 273         if (strcmp("*COM*", symbol_table[i]->section->name) == 0) {
> 
> Of course, we're not sure if the error "ERROR: text=0x7db78 overlaps
> data=0x6b940 ?" is fixed by your patch and a later problem causes the
> segfault, or if your patch causes the segfault in the first place.
> 
> Please note that if we revert both
> 32f93b0ef2c602dfa1f5b243ba865d5b16e2fa33 and
> 65d78dcfeb8b2eafaebe2d0c3c8c42e7e85f46ac in Buildroot, we have a
> working elf2flt for m68k.
> 
> Do you have any idea?
> 
> Thanks a lot!
> 
> Thomas



-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-08-06 20:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30  3:38 [Buildroot] [PATCH v2 00/11] Fix RV64 NOMMU and add Canaan K210 SoC support Damien Le Moal via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 01/11] package: elf2flt: fix config menu entry description Damien Le Moal via buildroot
2022-05-30 10:03   ` Alistair Francis
2022-05-30 18:59   ` Thomas Petazzoni via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 02/11] package: elf2flt: Update RISC-V 64-bits support Damien Le Moal via buildroot
2022-05-30 19:06   ` Thomas Petazzoni via buildroot
2022-07-25 14:44   ` Thomas Petazzoni via buildroot
2022-07-26  3:41     ` Damien Le Moal via buildroot
2022-07-26  9:30       ` Romain Naour
2022-08-06 20:47     ` Thomas Petazzoni via buildroot [this message]
2022-05-30  3:38 ` [Buildroot] [PATCH v2 03/11] board: Add common Linux kernel support for RISCV NOMMU builds Damien Le Moal via buildroot
2022-05-30 19:17   ` Thomas Petazzoni via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 04/11] configs/qemu_riscv64_nommu_virt_defconfig: new defconfig Damien Le Moal via buildroot
2022-05-30 19:18   ` Thomas Petazzoni via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 05/11] package: python-kflash: Kendryte K210 UART ISP Utility Damien Le Moal via buildroot
2022-05-30 19:31   ` Thomas Petazzoni via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 06/11] board: Add common support for Canaan K210 SoC-based boards Damien Le Moal via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 07/11] board: Add Sipeed MAIX-Bit board support Damien Le Moal via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 08/11] board: Add Sipeed MAIXDUINO " Damien Le Moal via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 09/11] board: Add Sipeed MAIX-Dock " Damien Le Moal via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 10/11] board: Add Sipeed MAIX-Go " Damien Le Moal via buildroot
2022-05-30  3:38 ` [Buildroot] [PATCH v2 11/11] board: Add Canaan KD233 " Damien Le Moal via buildroot
2022-05-30 10:19 ` [Buildroot] [PATCH v2 00/11] Fix RV64 NOMMU and add Canaan K210 SoC support Waldemar Brodkorb

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=20220806224750.62132558@windsurf \
    --to=buildroot@buildroot.org \
    --cc=Niklas.Cassel@wdc.com \
    --cc=alistair@alistair23.me \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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