From: Michael Shmulevich <michaels@jungo.com>
To: Ralf Baechle <ralf@oss.sgi.com>
Cc: Ian Thompson <iant@palmchip.com>, linux-mips@oss.sgi.com
Subject: Re: binutils 2.8.1 problems
Date: Tue, 08 May 2001 10:36:34 +0300 [thread overview]
Message-ID: <3AF7A202.6060705@jungo.com> (raw)
In-Reply-To: 20010505145344.B1252@bacchus.dhis.org
> So then is a binutils and not a compiler problem. What binutils are you
> using? Binutils 2.8.1 which I'm still recommending (mostly to avoid
> sending people into a maze of version dependencies) is getting dated and
> the bug may well have been fixed in the meantime.
I have met a weird bug in binutils 2.8.1 on mips lately: when using
".weak" directive in some module which make use of the same asliased
symbol, during linkage the symbol doesn't get relocated to a "strong"
symbol:
----------------------
in foo.c:
----------------------
extern void bar();
void foo(){
printf("A\n");
}
__asm__(".weak bar; bar = foo");
void f1(){
bar();
}
-----------------------
in bar.c:
----------------------
void bar(){
printf("B\n");
}
----------------------
in main.c:
----------------------
extern void bar();
extern void f1();
int main(){
f1();
bar();
}
-----------------------
This code produce printout of
A
B
since f1() always calls foo() no matter that bar() is defined outside.
AFIAIK, there is no ".weakext" macro in 2.8.1.
Using objdump on foo.o I see there is no relocation entry for bar,
however using gas-2.10 on exactly same assembly does produce relocation
entry. So it must definitely be a "gas" problem.
Sincerely yours,
Michael Shmulevich
______________________________________
Software Developer
Jungo - R&D
email: michaels@jungo.com
web: http://www.jungo.com
Phone: 1-877-514-0537(USA) +972-9-8859365(Worldwide) ext. 233
Fax: 1-877-514-0538(USA) +972-9-8859366(Worldwide)
prev parent reply other threads:[~2001-05-08 7:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-02 23:31 Debug format problem with -ggdb flag Ian Thompson
2001-05-05 17:53 ` Ralf Baechle
2001-05-08 7:36 ` Michael Shmulevich [this message]
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=3AF7A202.6060705@jungo.com \
--to=michaels@jungo.com \
--cc=iant@palmchip.com \
--cc=linux-mips@oss.sgi.com \
--cc=ralf@oss.sgi.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