gcc 4.4.0 arm/thumb interwork _from_arm bad stub generation

Adam Turowski adas@ikp.pl
Tue Jun 30 18:20:00 GMT 2009


I've manage to fix the problem with code shifting by 4 bytes. It looks like
linker doesn't like when the code section starts for adres 60dec. Changing
it to 64dec (0x40) fixes the shift problem and now binary and dissassembly
result are at the same place.

Here is linker file fixing shift issue. Before all 64dec values were 60dec.

RAM_ORIGIN = 0x200000;
RAM_SIZE = 64K;

MEMORY
{
   VECTORS_RUN : ORIGIN = 0x0, LENGTH = 64        /* reset and exceptions
vectors Flash mirror used when running the code */
   FLASH_RUN  : ORIGIN = 64, LENGTH = 256K - 64   /* Flash memory contents
mirror used when running the code */

   VECTORS : ORIGIN = 0x100000, LENGTH = 64                /* reset and
exceptions vectors in Flash memory */
   FLASH  : ORIGIN = 0x100000 + 64, LENGTH = 256K - 64     /* Flash memory
contents */

   RAM : ORIGIN = 0x200000, LENGTH = 64K    /* length of RAM */
}

__ram_end__ = RAM_ORIGIN + RAM_SIZE;

SECTIONS
{
/* setup TEXT section */
  startup :
  {
    *(.startup)
  } > VECTORS_RUN AT > VECTORS    /* vectors data lives in VECTORS region in
Flash memory, but will be mirrored to VECTORS_RUN for execution */

  prog :
  {
  __text_beg__ = .;
    *(.text)
    *(.rodata)
    *(.rodata*)
    *(.glue_7)
    *(.glue_7t)
    . = ALIGN(256);   /* there has to be alignment to 256 FLASH sector
boundary */
    *(.flash_sect)
    . = ALIGN(256);   /* there has to be alignment to next 256 FLASH sector
boundary to prevent accident erase of something */
                      /* which is placed after the reprogrammed sector */
  } >FLASH_RUN AT >FLASH
-- 
View this message in context: http://www.nabble.com/gcc-4.4.0-arm-thumb-interwork-_from_arm-bad-stub-generation-tp24016313p24277000.html
Sent from the gcc - Help mailing list archive at Nabble.com.



More information about the Gcc-help mailing list