public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* other/9682: unclear assembler/linker behaviour
@ 2003-02-13 0:16 bas
0 siblings, 0 replies; only message in thread
From: bas @ 2003-02-13 0:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 9682
>Category: other
>Synopsis: unclear assembler/linker behaviour
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Feb 13 00:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: bas aarts
>Release: unknown-1.0
>Organization:
>Environment:
bas@marilyn:~/public > gcc --version
gcc (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bas@marilyn:~/public > uname -a
Linux marilyn.cam.equator.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
>Description:
bas@marilyn:~/public > cat attr1.c
int a; extern int h __attribute__ ((alias ("a")));
bas@marilyn:~/public > cat attr2.c
extern int h; int main(void){return h;}
bas@marilyn:~/public > gcc -save-temps attr1.c attr2.c
attr2.o: In function `main':
attr2.o(.text+0x11): undefined reference to `h'
collect2: ld returned 1 exit status
I don't know why I have a missing symbol here
2 cases:
1) when in attr1.c, initializing a (so that its not a common anymore),
it links fine
2) when in attr1.s, the
.set h,a
.comm a,4,4
are interchanged into
.comm a,4,4
.set h,a
bas@marilyn:~/public > gcc -save-temps attr1.s attr2.c -nostdlib
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048074
bas@marilyn:~/public > nm a.out
0804908c A __bss_start
0804908c A _edata
08049094 A _end
08049090 B a
0804908c B h
08048074 T main
now a and h are two distinct symbols!
What is the semantics of the .set directive?
>How-To-Repeat:
see above
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-02-13 0:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-13 0:16 other/9682: unclear assembler/linker behaviour bas
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).