This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28746] gcc -g and shared objects
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Aug 2006 02:25:57 -0000
- Subject: [Bug c++/28746] gcc -g and shared objects
- References: <bug-28746-13105@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-08-16 02:25 -------
This works for me with exactly your version of GCC:
[pinskia@celery ~]$ vi t.cc
[pinskia@celery ~]$ gcc -g -fPIC t.cc -c
gt.cc: In destructor ?XYZ::~XYZ()?:
t.cc:11: error: expected `}' at end of input
c[pinskia@celery ~]$vi t.cc
[pinskia@celery ~]$ gcc -g -fPIC t.cc -c
gcc[pinskia@celery ~]$ gcc -shared -g -fPIC -o t.so.1 t.o
[pinskia@celery ~]$ readelf -l t.so.1
Elf file type is DYN (Shared object file)
Entry point 0x6c0
There are 5 program headers, starting at offset 52
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00000000 0x00000000 0x00ac4 0x00ac4 R E 0x1000
LOAD 0x000ac4 0x00001ac4 0x00001ac4 0x00124 0x0012c RW 0x1000
DYNAMIC 0x000ae0 0x00001ae0 0x00001ae0 0x000c0 0x000c0 RW 0x4
GNU_EH_FRAME 0x00099c 0x0000099c 0x0000099c 0x00044 0x00044 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
Section to Segment mapping:
Segment Sections...
00 .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt
.init .plt .text .fini .rodata .eh_frame_hdr .eh_frame
01 .ctors .dtors .jcr .data.rel.ro .dynamic .got .got.plt .data .bss
02 .dynamic
03 .eh_frame_hdr
04
[pinskia@celery ~]$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28746