public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/29621] librtld.os: in function `__register_frame': libgcc/unwind-dw2-fde.c:136: undefined reference to `malloc'
Date: Fri, 28 Oct 2022 13:19:19 +0000	[thread overview]
Message-ID: <bug-29621-131-jaow0C7QeP@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29621-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29621

--- Comment #12 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Florian Weimer from comment #11)
> (In reply to Adhemerval Zanella from comment #7)
> > Ok, with this one I can see the buildroot failure. It seems that it is
> > misconfiguring the stage1 gcc, where the libgcc.a generated is relying on
> > the libc for unwinding (thus why ld.so link is failing).
> 
> No, this is expected. The libgcc unwinder has depended on glibc symbols for
> many, many years. The unwinder cannot be linked into ld.so.
> 
> Someone needs to use ld tracing to figure out why __register_frame is pulled
> into the ld.so link.

What I am trying to say is buildroot generated stage1 compiler with libgcc.a
for mipsle that is not what glibc expects.  The buildroot symbol trace for
librtld.so shows:

$ /tmp/buildroot/output/host/mipsel-buildroot-linux-gnu/bin/ld [...]
--trace-symbol=__register_frame
/tmp/buildroot/output/host/mipsel-buildroot-linux-gnu/bin/ld:
/tmp/buildroot/output/host/lib/gcc/mipsel-buildroot-linux-gnu/11.3.0/libgcc.a(unwind-dw2-fde-dip.o):
definition of __register_frame

However even the stage2 gcc11 from the build-many-glibc does not links against
the unwinder:

$ mips64el-glibc-linux-gnu-ld -plugin [...] --trace-symbol=__register_frame
$ 

It does not container any unwinder routines:

$ ./bin/mips64el-glibc-linux-gnu-objdump -t
./lib/gcc/mips64el-glibc-linux-gnu/11.3.1/libgcc.a | grep unwind
$ 

It is in fact on libgcc_eh.a:

$ ./bin/mips64el-glibc-linux-gnu-objdump -t
./lib/gcc/mips64el-glibc-linux-gnu/11.3.1/libgcc_eh.a | grep unwind
unwind-dw2.o:     file format elf32-ntradlittlemips
00000000 l    df *ABS*  00000000
/home/azanella/toolchain/src/gcc/libgcc/unwind-dw2.c
unwind-dw2-fde-dip.o:     file format elf32-ntradlittlemips
00000000 l    df *ABS*  00000000
/home/azanella/toolchain/src/gcc/libgcc/unwind-dw2-fde.c
unwind-sjlj.o:     file format elf32-ntradlittlemips
unwind-c.o:     file format elf32-ntradlittlemips
00000000 l    df *ABS*  00000000
/home/azanella/toolchain/src/gcc/libgcc/unwind-pe.h

$ ./bin/mips64el-glibc-linux-gnu-objdump -t
./lib/gcc/mips64el-glibc-linux-gnu/11.3.1/libgcc_eh.a | grep __register_frame
00002090 g     F .text  000000d8 .hidden __register_frame_info_bases
00002168 g     F .text  000000d8 .hidden __register_frame_info
00002240 g     F .text  0000006c .hidden __register_frame
000022b0 g     F .text  000000b0 .hidden __register_frame_info_table_bases
00002360 g     F .text  000000b0 .hidden __register_frame_info_table
00002410 g     F .text  000000d0 .hidden __register_frame_table

I am not sure if this is a multilib issue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-10-28 13:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 19:44 [Bug libc/29621] New: " james.hilliard1 at gmail dot com
2022-09-27 19:44 ` [Bug libc/29621] " james.hilliard1 at gmail dot com
2022-09-29 17:45 ` adhemerval.zanella at linaro dot org
2022-09-29 19:51 ` james.hilliard1 at gmail dot com
2022-10-17 12:42 ` adhemerval.zanella at linaro dot org
2022-10-26 18:54 ` james.hilliard1 at gmail dot com
2022-10-26 19:10 ` adhemerval.zanella at linaro dot org
2022-10-26 19:33 ` james.hilliard1 at gmail dot com
2022-10-27 14:04 ` adhemerval.zanella at linaro dot org
2022-10-27 19:57 ` james.hilliard1 at gmail dot com
2022-10-27 21:05 ` adhemerval.zanella at linaro dot org
2022-10-27 21:35 ` james.hilliard1 at gmail dot com
2022-10-28  5:28 ` fweimer at redhat dot com
2022-10-28 13:19 ` adhemerval.zanella at linaro dot org [this message]
2022-10-28 13:36 ` adhemerval.zanella at linaro dot org
2022-10-28 16:18 ` james.hilliard1 at gmail dot com
2022-10-28 16:32 ` adhemerval.zanella at linaro dot org
2022-10-28 21:23 ` james.hilliard1 at gmail dot com
2022-11-24 17:01 ` arnout at mind dot be
2022-11-24 17:21 ` arnout at mind dot be
2022-11-24 17:27 ` fweimer at redhat dot com
2023-08-07  9:37 ` sam at gentoo dot org
2024-01-11  9:41 ` fweimer at redhat dot com

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=bug-29621-131-jaow0C7QeP@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).