public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Dave Korn" <dave.korn@artimi.com>
To: "'Øyvind Harboe'" <oyvind.harboe@zylin.com>, binutils@sources.redhat.com
Subject: RE: Referenced symbol not present in final image?
Date: Fri, 08 Apr 2005 12:17:00 -0000	[thread overview]
Message-ID: <SERRANO5y4FypKsEgJX000000bb@SERRANO.CAM.ARTIMI.COM> (raw)
In-Reply-To: <1112958897.23080.32.camel@localhost.localdomain>

----Original Message----
>From: Øyvind Harboe
>Sent: 08 April 2005 12:15

> One more thing:
> 
> If I add -Wl,--undefined=pthread_mutex_lock, I get the expected result,
> i.e. that the pthread_mutex_lock fn is included in the final image.
> 
> $ arm-elf-gcc   -Wl,-static -g -nostdlib  -nostartfiles
>   -L../romapp/install/lib -Ttarget.ld [truncated] 
> -Wl,-Map,output/rimi.map   -Wl,--trace-symbol=pthread_mutex_lock 
> -Wl,--undefined=pthread_mutex_lock
>
/ecos-c/cdtworkspace/arm/install/bin/../lib/gcc/arm-elf/3.4.3/../../../../ar
m-elf/lib/libsupc++.a(eh_alloc.o):
> reference to pthread_mutex_lock
>
/ecos-c/cdtworkspace/arm/install/bin/../lib/gcc/arm-elf/3.4.3/../../../../ar
m-elf/lib/libstdc++.a(locale_init.o):
> reference to pthread_mutex_lock
>
/ecos-c/cdtworkspace/arm/install/bin/../lib/gcc/arm-elf/3.4.3/../../../../ar
m-elf/lib/libstdc++.a(allocator-inst.o):
> reference to pthread_mutex_lock
> ../romapp/install/lib/libtarget.a(compat_posix_mutex.o): definition of
> pthread_mutex_lock      


  Umm, look, if you really want to know what kind of symbol it is, don't you
just want to be using "nm" or "objdump --syms" on eh_alloc.o (or libsupc++),
and it'll probably tell you something interesting like it's weak, or common,
or somesuch ?

  If it's referenced, but doesn't get pulled into the link unless you -U it
on the linker command line, that suggests that the object that contains it
is too early in the link order and the objects that reference it are too
late in the link order, so by the time the linker knows it's needed, it's
already gone by and be discarded.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

  reply	other threads:[~2005-04-08 12:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-08 11:14 Øyvind Harboe
2005-04-08 12:17 ` Dave Korn [this message]
2005-04-08 12:31   ` Øyvind Harboe
  -- strict thread matches above, loose matches on Subject: below --
2005-04-08 10:30 Øyvind Harboe
2005-04-08 12:23 ` Ravi Ramaseshan

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=SERRANO5y4FypKsEgJX000000bb@SERRANO.CAM.ARTIMI.COM \
    --to=dave.korn@artimi.com \
    --cc=binutils@sources.redhat.com \
    --cc=oyvind.harboe@zylin.com \
    /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).