public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@avtrex.com>
To: dank@kegel.com
Cc: gcc@gcc.gnu.org,  binutils@sources.redhat.com
Subject: Re: RFH: libgcc_s.so being unnecessarily linked for mipsel-linux crosscompiler...
Date: Fri, 29 Jul 2005 02:40:00 -0000	[thread overview]
Message-ID: <42E996FD.1000208@avtrex.com> (raw)
In-Reply-To: <60776.64.85.15.162.1122599245.squirrel@webmail4.pair.com>

dank@kegel.com wrote:
> ddaney wrote:
> 
>>I have a a mipsel-linux cross compiler (gcc-3.4.3/binutils-2.16.1)
>>and whenever I compile even the simplest hello-world.c libgcc_s.so is
> 
> linked.
> 
> 
> Just curious -- how did you build your cross-compiler?

I have a bunch of rpm build scripts, but they pretty much just do a 
standard configure and make.

I never do a clean build of glibc and gcc in the same pass so I don't 
have the chicken and egg glibc header file problem.

> Do toolchains built by crosstool have this problem?

I have not checked, but I suspect so.

The problem is in the linker.  I am trying to fix it, but ld is an ugly 
beast.

It seems that the linker thinks that any shared object that references 
the magic _gp_disp symbol actually provides it.  Since all mips objects 
reference _gp_disp, ld thinks that all shared objects are required to 
resolve all the other _gp_disp references.  This causes all shared 
objects specified with --as-needed to be deemed needed and get a 
DT_NEEDED entry.

The linker automagically resolves _gp_disp so this symbol should not 
cause a shared library to be needed.

I hope that makes at least a little sense.

I suspect that the problem is mips specific as _gp_disp handling is mips 
specific.

David Daney

  reply	other threads:[~2005-07-29  2:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-29  1:07 dank
2005-07-29  2:40 ` David Daney [this message]
2005-07-29  3:20   ` Daniel Jacobowitz
2005-07-29  3:36     ` David Daney
2005-07-29  5:53       ` Alan Modra

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=42E996FD.1000208@avtrex.com \
    --to=ddaney@avtrex.com \
    --cc=binutils@sources.redhat.com \
    --cc=dank@kegel.com \
    --cc=gcc@gcc.gnu.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).