This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

target/5717: ppc-eabi-g++ emits wrong relocation type for typeid(std::bad_exception) when -meabi specified.



>Number:         5717
>Category:       target
>Synopsis:       ppc-eabi-g++ emits wrong relocation type for typeid(std::bad_exception) when -meabi specified.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 18 03:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     osv@javad.ru
>Release:        3.0.4 20020218 (prerelease)
>Organization:
>Environment:
Linux falcon 2.2.14 #2 SMP Sat Apr 15 13:24:18 MSD 2000 i686 unknown
>Description:
When the attached code is compiled with -meabi -msdata=default command-line
options, the resulting assembler code refers to the "_ZTISt13bad_exception"
symbol as if it is placed in small constant data section. The wrong asm
statement is:

la %r3,_ZTISt13bad_exception@sda21(0)

However, the symbol itself is in the section
".gnu.linkonce.r._ZTISt13bad_exception" that is not a small data section.

Attempt to link the resulting code then fails with the following error:

".../ld: test.o: The target (typeinfo for std::bad_exception) of a
R_PPC_EMB_SDA21 relocation is in the wrong output section (.rodata)"
>How-To-Repeat:
Compile/link attached "test.cc" like this:

~/try/eabi/bin/ppc-eabi-g++ -v -O2 -meabi -msdata=default -save-temps -mregnames -nostartfiles test.cc 
Reading specs from /home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/specs
Configured with: /home/osv/cygnus/gcc/configure --prefix=/home/osv/try/eabi --target=ppc-eabi --disable-nls --with-gnu-as --with-gnu-ld -with-newlib
Thread model: single
gcc version 3.0.4 20020218 (prerelease)
 /home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/cpp0 -lang-c++ -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=4 -DPPC -D__embedded__ -D__PPC__ -D__embedded__ -D__PPC -Asystem=embedded -Acpu=powerpc -Amachine=powerpc -D__CHAR_UNSIGNED__ -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -D_CALL_SYSV -D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian -D_ARCH_PPC test.cc test.ii
GNU CPP version 3.0.4 20020218 (prerelease) (cpplib) (PowerPC Embedded)
ignoring nonexistent directory "/home/osv/try/eabi/ppc-eabi/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /home/osv/try/eabi/include/g++-v3
 /home/osv/try/eabi/include/g++-v3/ppc-eabi
 /home/osv/try/eabi/include/g++-v3/backward
 /home/osv/try/eabi/include
 /home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/include
 /home/osv/try/eabi/ppc-eabi/include
End of search list.
 /home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/cc1plus -fpreprocessed test.ii -mcall-sysv -quiet -dumpbase test.cc -meabi -msdata=default -mregnames -O2 -version -o test.s
GNU CPP version 3.0.4 20020218 (prerelease) (cpplib) (PowerPC Embedded)
GNU C++ version 3.0.4 20020218 (prerelease) (ppc-eabi)
	compiled by GNU C version 2.95.2 20000313 (Debian GNU/Linux).
 /home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/../../../../ppc-eabi/bin/as -mppc -V -Qy -o test.o test.s
GNU assembler version 2.11.2 (ppc-eabi) using BFD version 2.11.2
 /home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/collect2 -V -Qy -dn -Bstatic -L/home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4 -L/home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/../../../../ppc-eabi/lib test.o -lstdc++ -lm -lgcc -lgcc
/home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/../../../../ppc-eabi/bin/ld: test.o: The target (typeinfo for std::bad_exception) of a R_PPC_EMB_SDA21 relocation is in the wrong output section (.rodata)
/home/osv/try/eabi/lib/gcc-lib/ppc-eabi/3.0.4/../../../../ppc-eabi/bin/ld: final link failed: Bad value
GNU ld version 2.11.2 (with BFD 2.11.2)
  Supported emulations:
   elf32ppc
   elf32ppclinux
   elf32ppcsim
collect2: ld returned 1 exit status

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="test.cc.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc.gz"

H4sICCTjcDwAA3Rlc3QuY2MAHctRCoMwEATQ/z3FYKEkV7DSnx4k2GSFgOxKshaLeHeNfzPDm0eW
OK+JMdh/4SyTvomqpb5vPbQBUaXaE5Oq87QTUNjWIrgfCe7m3zEF3iIvllX8iw4i3owv1n06/PSC
odpYzLXssR90Ak3SQwh8AAAA


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]