bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ld bug - thumb code


From: andy parker
Subject: Re: ld bug - thumb code
Date: Mon, 02 Sep 2002 12:05:15 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530

Hi Nick,

Apologies for confusion over the test case. cdbg() is a home-spun output stream providing some iostream-like functionality via a serial port. You can just delete these lines or replace with cdbg() with cout, if your system supports it.

The arm compiler I'm using is arm-elf-g++ version 3.2.
My compiler command line is:

arm-elf-g++ -pipe -Wall -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -fno-omit-frame-pointer -mlittle-endian -fbuiltin -fno-exceptions -fno-rtti -mcpu=arm9 -mno-sched-prolog -fno-exceptions -fno-rtti -Os -finline-functions -finline-limit=250 -mthumb -Isrc -c src/a.cxx -o object/a.o

I have stripped out the the internal library calls and attached an example tarball which builds two simple test cases, one arm and one thumb. In this case, the linker does not produce a relocation eror, but I believe the code is wrong, and this may be related the original relocation error.

The disassembled thumb image appears to contain a corrupted thunk:

00000188 <_ZThn4_N1C1FEv>:
 188:    3804          sub    r0, #4
 18a:    e345          b    818 <_ramstart+0x68c>
since no valid code exists at 818.

However, the arm case correctly branches to C::F(),
00000194 <_ZThn4_N1C1FEv>:
 194:    e2400004     sub    r0, r0, #4    ; 0x4
 198:    eaffffd2     b    e8 <_ZN1C1FEv>

Any thoughts ?

Cheers,
Andy Parker

Attachment: eg.tar.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]