good day people:
i have been using GNUARM/Cygwin for some time now and i have not
encountered a problem like this before.
BACKGROUND
- target MCU is STR71x
- CPU core is ARM7TDMI
- toolchain is GNUARM 4.1.1 on Cygwin
- source code
- the first file to be linked is an ARM assembly .s file
that contains the ARM vector table and handler addresses.
the vector table is in a separate section called .VhaInit.
when linked, it is located to 0x20000000 (SRAM) or
0x40000000 (Flash)
- the second file is another ARM assembly .s file that contains
C startup code. when linked, the .text is located to 0x20000080
(SRAM) or 0x40000080 (Flash), just after .VhaInit.
- assembly files are assembled with -mthumb-interworking but are
written in pure ARM code.
- there is a C file that is compiled with -mthumb
-mthumb-interworking.
- i also link with -gc-sections, and C code is compiled with
-ffunction-sections and -fdata-sections so that unused C code is
eliminated by the linker.
- ResetHandler entry is set to 0x400C0000 using --defsym option of
LD: --defsym ResetHandler=0x400C0000
PROBLEM
- when i add code to access .VhaInit entries from .text to prevent the
garbage collection of .VhaInit, Thumb Interworking code is ZERO. the
entries are present, but no interworking code is present.
- when i remove code that accesses .VhaInit, Interworking code is
correct.
- when i disable -ffunction-sections, -fdata-sections, and
-gc-sections, and when i still access data in .VhaInit from .text,
Interworking is correct.
so, what's going on? 8-)
i think its a bug in GNU LD.
any help will be gratefully accepted.
have a nice day,
Aaron
--
{tel: +91-20-6526-7076; cell: +91-9970-591-079; fax: +1-800-450-5419}