public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/24395] New: -funit-at-a-time drops used functions (IMA mode)
@ 2005-10-15 23:41 rep dot nop at aon dot at
2005-10-15 23:43 ` [Bug c/24395] " rep dot nop at aon dot at
2005-10-16 0:22 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: rep dot nop at aon dot at @ 2005-10-15 23:41 UTC (permalink / raw)
To: gcc-bugs
When building a library in IMA mode, several used functions are optimized away:
gcc-4.1-HEAD -W -Wall -pedantic -funit-at-a-time -DPIC -fPIC -o liblib.o -c
lib.c lib1.c lib2.c
strip -x -R .note -R .comment liblib.o
ar cr liblib.a liblib.o
ld -shared --warn-common --warn-once -z combreloc -z defs -s -rpath . \
-soname=liblib.so -o liblib.so --whole-archive liblib.a --no-whole-archive -lc
Do we have all of libmain, __func1, __func2 ?
nm -D --defined-only liblib.so
00001260 A __bss_start
000011e4 A _DYNAMIC
00001260 A _edata
00001260 A _end
000001bc T __func2
gcc-4.1-HEAD -W -Wall -pedantic -I. test.c -o libtest -L. -llib
/tmp/ccsGhigf.o: In function `main':
test.c:(.text+0x43): undefined reference to `libmain'
collect2: ld returned 1 exit status
make: *** [libtest] Error 1
This would be the expected result:
nm -D --defined-only liblib.so
0000138c A __bss_start
000012e8 A _DYNAMIC
0000138c A _edata
0000138c A _end
00000234 T __func1
0000025b T __func2
00000282 T libmain
--
Summary: -funit-at-a-time drops used functions (IMA mode)
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rep dot nop at aon dot at
GCC build triplet: i686-linux-gnu
GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24395
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/24395] -funit-at-a-time drops used functions (IMA mode)
2005-10-15 23:41 [Bug c/24395] New: -funit-at-a-time drops used functions (IMA mode) rep dot nop at aon dot at
@ 2005-10-15 23:43 ` rep dot nop at aon dot at
2005-10-16 0:22 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: rep dot nop at aon dot at @ 2005-10-15 23:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rep dot nop at aon dot at 2005-10-15 23:43 -------
Created an attachment (id=9994)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9994&action=view)
testcase for a miscompiled library
A small pseudo library is attached as an example.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24395
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/24395] -funit-at-a-time drops used functions (IMA mode)
2005-10-15 23:41 [Bug c/24395] New: -funit-at-a-time drops used functions (IMA mode) rep dot nop at aon dot at
2005-10-15 23:43 ` [Bug c/24395] " rep dot nop at aon dot at
@ 2005-10-16 0:22 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-16 0:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2005-10-16 00:22 -------
oh:
cc -W -Wall -pedantic -funit-at-a-time -DPIC -fPIC -o liblib.o -c lib.c lib1.c
lib2.c
you forgot -combine.
And this is a dup of bug 22544.
*** This bug has been marked as a duplicate of 22544 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24395
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-10-16 0:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-15 23:41 [Bug c/24395] New: -funit-at-a-time drops used functions (IMA mode) rep dot nop at aon dot at
2005-10-15 23:43 ` [Bug c/24395] " rep dot nop at aon dot at
2005-10-16 0:22 ` pinskia at gcc dot gnu dot org
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).