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

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

BUG? arm-elf-ld with interworking


From: Stanley Gambarin
Subject: BUG? arm-elf-ld with interworking
Date: Thu, 20 Feb 2003 19:58:42 -0800 (PST)

Hello,

  I think I've ran into a bug in arm-elf-ld trying to
get Arm/Thumb interwork working :).  If someone else
is seeing this, please let me know; otherwise i'll 
continue my hunt.

Setup:
host: solaris 2.8
target: arm-elf
arm-elf-gcc (3.2.2)
arm-elf-ld (binutils 2.12).
newlib (1.10.0) - built with -msoft-float
-mthumb-interwork

create 2 files, arm.c & thumb.c; arm.c contain
main() and call to thumb_func() and some printfs 
in it, thumb.c contains definition of thumb_func()
with some printfs.  compile as follows:

arm-elf-gcc -mthumb -msoft-float -mthumb-interwork -c
thumb.c
arm-elf-gcc -msoft-float -mthumb-interwork -c arm.c
arm-elf-gcc -mthumb -msoft-float -mthumb-interwork
arm.c thumb.c

what I am seeing is that the executable is not created
properly.  Looking at the code:  the linker will note
a call from thumb mode into arm mode (i.e. crt0.o 
calling main) and will change that call to a call to
func_from_thumb.  This (func_from_thumb) is generated
by the linker; the linker will allocate a section
(called either .glue_7 or .glue_7t) with appropriate
instructions and attach it to the last bfd in the link
line (i.e. crtn.o in my case).  
the problem, it seems is that when linker is copying 
section data from input bfd's to output, it will copy
an empty contents of the .glue_7 section from crtn.o
into executable.  The instructions will be filled in
later when relocations will be performed and the
linker
will note that Thumb->Arm call is being made.  Under
debugger I hit a breakpoint
(_bfd_elf_set_section_contents)
 when writing out .glue_7 section of crtn.o before I
relocate (and consequently update the instruction 
sequence) in elf32_thumb_to_arm_stub function.  It
looks like the link_order is messed up; I use the
stock linker script for arm-elf target.  If somebody
who is more familiar with linker internals can shed 
some light on this, would be appreciated.  

thanks,
-- stanley


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/




reply via email to

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