This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Thumb (PLT) problem
- From: Nick Clifton <nickc at redhat dot com>
- To: Kovacs dot Ferenc dot 5 at stud dot u-szeged dot hu
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 09 Mar 2005 12:29:02 +0000
- Subject: Re: Thumb (PLT) problem
- References: <1110367360.422edc803f618@www.stud.u-szeged.hu>
Hi Feri,
I have to rewrite the files `$UCLIBC_PATH/libc/sysdeps/linux/
arm/*' to work in thumb mode.
Poor you. :-) You couldn't just add an thumb prologue to these
functions which switches into ARM mode and then continues with the real
function ? (Plus a suitable epilogue to switch back, of course).
bsd-setjmp.S:36: Error: garbage following instruction --
`b __sigsetjmp(PLT)'
The assembler is complaining about the "(PLT)". It does not understand
this annotation when working in THUMB mode.
And what is (PLT) for here?
It tells the assembler to generate an R_ARM_PLT32 reloc for the branch
instruction instead of an R_ARM_PC24 reloc. (If you do not know what a
PLT is, or a reloc for that matter, then you are in for a lot of fun,
and reading, in order to understand what is going on here).
Of course your next question is probably going to be "how do I code the
same thing in THUMB mode then ?" The simple answer is to drop the
(PLT), by removing the use of the PLTJMP() macro from inside
bsd-setjmp.S. Of course you would only want to do this if you are
operating in THUMB mode, so possibly you may want to extend the PLTJMP
macro to do nothing if it can detect that you are generating THUMB code.
Cheers
Nick