|
|
Message-ID: <ZskKCSueNCn3Ltg-@probook>
Date: Sat, 24 Aug 2024 00:15:37 +0200
From: J. Neuschäfer <j.neuschaefer@....net>
To: Rich Felker <dalias@...c.org>
Cc: J. Neuschäfer <j.neuschaefer@....net>,
lvm-devel@...ts.linux.dev, buildroot@...ldroot.org,
musl@...ts.openwall.com
Subject: Re: [PATCH lvm2] acinclude.m4: Link when trying CCFLAGS
On Sun, Aug 11, 2024 at 05:52:29PM -0400, Rich Felker wrote:
> On Sun, Aug 11, 2024 at 11:04:38AM +0200, J. Neuschäfer wrote:
> > Through a build failure of LVM2 on musl-libc 1.2.5 in the Buildroot
> > autobuild service[1], I noticed that musl-libc's Scrt1 for microblaze
> > produces a relocation targeting the .text section, which subsequently
> > leads to a crash at run-time because musl-libc does not support
> > textrels[2]. Buildroot uses the "-z text" linker option to catch
> > textrels early, on musl-libc.
> >
> > The error can be reduced to the following test case:
> >
> > $ cat hello.c
> > #include <stdio.h>
> > int main(void) { puts("Hello world!"); return 0; }
> > $ host/bin/microblaze-buildroot-linux-musl-gcc hello.c -z text -pie -fPIC
> > microblaze-buildroot-linux-musl/bin/ld: microblaze-buildroot-linux-musl/sysroot/lib/Scrt1.o:
> > warning: relocation against `_start_c' in read-only section `.text'
> > microblaze-buildroot-linux-musl/bin/ld: read-only segment has dynamic relocations
> > collect2: error: ld returned 1 exit status
[...]
>
> No objection, but this is a bug in the tooling (ld) that we could also
> avoid on the musl side. So there are probably 3 places things should
> be changed here.
>
> Rich
I finally got around to testing your musl patch (http://0x0.st/XWB9.diff -
"use hidden visibility for C entry point function _start_c").
It solves the immediate problem for microblaze(el) as far as I can see.
I'm not familiar enough with linker intricacies to write a binutils/ld
bug report though.
-- jn
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.