Bug 11111 - 'defined in discarded section' linker error using gcc 4.1.2 and binutils 2.18
Summary: 'defined in discarded section' linker error using gcc 4.1.2 and binutils 2.18
Status: RESOLVED WONTFIX
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-21 21:41 UTC by Mahesh Athi
Modified: 2010-01-08 03:03 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mahesh Athi 2009-12-21 21:41:33 UTC
trying to compile c++ files into a shared library using gcc 4.1.2 and ld 2.18.
getting following error:
gcc -shared -dy -L/hwapps/dvg/4.5.3/lib/Linux -o ./lib/Linux/libathirtt.so -lc
-lm -lmdk ./obj/Linux/d.o ./obj/Linux/ds.o ./obj/Linux/dsa.o ./obj/Linux/s.o
./obj/Linux/sl.o ./obj/Linux/r.o ./obj/Linux/c.o ./obj/Linux/b.o
./obj/Linux/de.o ./obj/Linux/g.o ./obj/Linux/i.o ./obj/Linux/p.o
./obj/Linux/ra.o ./obj/Linux/re.o ./obj/Linux/unsolicited_trans.o
./obj/Linux/debug_port.o 

`.L527' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o:
defined in discarded section
`.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of
./obj/Linux/unsolicited_trans.o
`.L529' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o:
defined in discarded section
`.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of
./obj/Linux/unsolicited_trans.o
`.L534' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o:
defined in discarded section
`.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of
./obj/Linux/unsolicited_trans.o
`.L536' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o:
defined in discarded section
`.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of
./obj/Linux/unsolicited_trans.o
`.L539' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o:
defined in discarded section
`.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of
./obj/Linux/unsolicited_trans.o
`.L542' referenced in section `.rodata' of ./obj/Linux/unsolicited_trans.o:
defined in discarded section
`.gnu.linkonce.t._ZN17SRIOBFMUserPacket13RandomizeSizeEv' of
./obj/Linux/unsolicited_trans.o
collect2: ld returned 1 exit status

Any help would be appreciated!
Comment 1 H.J. Lu 2009-12-22 00:34:06 UTC
It is an gcc bug.  You can first try binutils 2.20 to see if it can
work around it. If it doesn't work, you need to update your gcc.
Comment 2 Alan Modra 2010-01-08 03:03:33 UTC
No 2.18 or 2.19 updates are planned for FSF binutils, and as HJ says, this is
really a gcc bug.