This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
problems with GCC-3.2.1 and new/delete operators.
- From: marco at sitek dot it
- To: ecos-discuss at sources dot redhat dot com
- Date: Mon, 31 Mar 2003 18:21:16 +0200
- Subject: [ECOS] problems with GCC-3.2.1 and new/delete operators.
Hello. I am experiencing problems with new/delete/GCC-3.2.1 and would need
some suggestions.
+Moving an eCos application that compiles/runs fine with 2.95.2, I had
while linking (just reporting the error message):
(...cut...)
undefined reference to `operator new(unsigned)'
undefined reference to `operator delete(void*)'
undefined reference to `operator new(unsigned)'
undefined reference to `operator delete[](void*)'
undefined reference to `operator new[](unsigned)'
(...cut...)
+ I therefore grouped libsupc++.a to libtarget.a and added the Bart's
patch to get the __impure_ptr fix in the INFRA package
(prevously in the list was suggested to get the same effect using
-Wl,--defsym -Wl,__cxa_pure_virtual=0). pure.cxx is included.
I can pass the undefined reference error but other things pop up.
Please, see below. Seems I lack some sections in the linker script that
are required when using libsupc++. Is this correct? If yes, is
there a reference script I could look at?
My toolchain is mipsisa32-elf-* (ecoscentric) and I am compiling the
application code with these flags:
"-EL -mips2 -G0 -msoft-float -Wall -ffunction-sections -fdata-sections
-fno-exceptions -fno-rtti -finit-priority -Wno-deprecated"
while linking with:
"-EL -msoft-float -nostartfiless -Wl,--gc-sections -fno-exceptions
-fno-rtti -nostdlib"
Thanks in advance.
Marco
(...cut...)
make[1]: Entering directory `/ecos/work-new/ooicu/icu/src/ftp/server'
mipsisa32-elf-gcc -EL -msoft-float -nostartfiles
-L../../../../icu/lib/release -L/ecos/work-new//complete_scm40_install/lib
-Wl,--gc-sections -fno-exceptions -fno-rtti -nostdlib -o release/ftp.exe
release/ftpmain.o -lutils -lftp -lplatform -Ttarget.ld -nostdlib
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
warning: no memory region specified for section
`.gnu.linkonce.s._ZTISt9exception'
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
warning: no memory region specified for section
`.gnu.linkonce.s._ZTISt9type_info'
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x10 of release/ftp.exe section .data1 is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x10 of release/ftp.exe section .eh_frame is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x10 of release/ftp.exe section .gcc_except_table is not within
region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x68 of release/ftp.exe section .ctors is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0xa8 of release/ftp.exe section .dtors is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3b8 of release/ftp.exe section .devtab is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3b8 of release/ftp.exe section .got is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3b8 of release/ftp.exe section .dynamic is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3c0 of release/ftp.exe section .sdata is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3c0 of release/ftp.exe section .lit8 is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
warning: no memory region specified for section
`.gnu.linkonce.s._ZTISt9exception'
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
warning: no memory region specified for section
`.gnu.linkonce.s._ZTISt9type_info'
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x10 of release/ftp.exe section .data1 is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x10 of release/ftp.exe section .eh_frame is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x10 of release/ftp.exe section .gcc_except_table is not within
region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x68 of release/ftp.exe section .ctors is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0xa8 of release/ftp.exe section .dtors is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3b8 of release/ftp.exe section .devtab is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3b8 of release/ftp.exe section .got is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3b8 of release/ftp.exe section .dynamic is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3c0 of release/ftp.exe section .sdata is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/bin/ld:
address 0x3c0 of release/ftp.exe section .lit8 is not within region ram
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/lib/soft-float/el/libsupc++.a(new_handler.o):
In function `std::set_new_handler(void (*)())':
new_handler.o(.text+0x0): relocation truncated to fit: R_MIPS_GPREL16
__new_handler
new_handler.o(.text+0x4): relocation truncated to fit: R_MIPS_GPREL16
__new_handler
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/lib/soft-float/el/libsupc++.a(new_op.o):
In function `operator new(unsigned)':
new_op.o(.text+0x3c): relocation truncated to fit: R_MIPS_GPREL16
__new_handler
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/lib/soft-float/el/libsupc++.a(eh_alloc.o):
In function `__cxa_allocate_exception':
eh_alloc.o(.text+0x4c): relocation truncated to fit: R_MIPS_GPREL16 no
symbol
eh_alloc.o(.text+0xa0): relocation truncated to fit: R_MIPS_GPREL16 no
symbol
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/lib/soft-float/el/libsupc++.a(eh_alloc.o):
In function `__cxa_free_exception':
eh_alloc.o(.text+0xf8): relocation truncated to fit: R_MIPS_GPREL16 no
symbol
eh_alloc.o(.text+0x100): relocation truncated to fit: R_MIPS_GPREL16 no
symbol
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/lib/soft-float/el/libsupc++.a(eh_globals.o):
In function `__cxa_get_globals_fast':
eh_globals.o(.text+0x0): relocation truncated to fit: R_MIPS_GPREL16 no
symbol
/tools/mipsisa32-elf/bin/../lib/gcc-lib/mipsisa32-elf/3.2.1/../../../../mipsisa32-elf/lib/soft-float/el/libsupc++.a(eh_globals.o):
In function `__cxa_get_globals':
eh_globals.o(.text+0xc): relocation truncated to fit: R_MIPS_GPREL16 no
symbol
collect2: ld returned 1 exit status
make[1]: *** [release/ftp.exe] Error 1
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss