This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ROMRAM vs ROM


Hi again:) finally I have a working ROMRAM image for redboot, thanks a lot!
now I am trying to create a ROM one. however, I get "relocation
truncated to fit" error.
I made a search and found out that:
The ARM branch instructions (b, bl) have a 23 bit offset
part in the instruction. If the trasfer target is farther
away from the jump/call then the offset allows, you'll
get the warning (and the code does not work)
http://www.motherboardpoint.com/relocation-truncated-fit-error-means-t94967.html

is that true? how can I fix it? below is my ldi for ROMRAM which works fine:
MEMORY
{
    sram : ORIGIN = 0x0, LENGTH = 0x2000
    ram : ORIGIN = 0x20800000, LENGTH = 0x03800000
    rom : ORIGIN = 0x30000000, LENGTH = 0x0400000
}

SECTIONS
{
    SECTIONS_BEGIN
    SECTION_fixed_vectors (sram, 0x20, LMA_EQ_VMA)
    SECTION_fixed_header (ram, 0x20800000, LMA_EQ_VMA)
    SECTION_rom_vectors (ram, 0x20800100, LMA_EQ_VMA)
    SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata1 (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_got (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fixup (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_gcc_except_table (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_data (ram, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
    CYG_LABEL_DEFN(__pci_window) = 0xf00000; . =
CYG_LABEL_DEFN(__pci_window) + 0x100000;
    SECTIONS_END
}

Since all adresses are in ram, no problem occurs. but in ROM ldi, I
need to jump from rom to ram in data section:
MEMORY
{
    ram : ORIGIN = 0x20800000, LENGTH = 0x03800000
    //sram : ORIGIN = 0x32000000, LENGTH = 0x01000000
    rom : ORIGIN = 0x30000000, LENGTH = 0x00400000
}

SECTIONS
{
    SECTIONS_BEGIN
    SECTION_fixed_header (rom, 0x30000000, LMA_EQ_VMA)
    SECTION_rom_vectors (rom, 0x3000002C, LMA_EQ_VMA)
    SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
    //SECTION_RELOCS (rom, ALIGN (0x1), LMA_EQ_VMA)
    SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata1 (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_got (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_gcc_except_table (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fixed_vectors (ram, 0x20800020, LMA_EQ_VMA)
    SECTION_data (ram, 0x20808000, FOLLOWING (.gcc_except_table))
    SECTION_bss (ram, ALIGN (0x4), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__heap1) = ALIGN (0x8);
    //CYG_LABEL_DEFN(__sram) = 0x32000000;
    CYG_LABEL_DEFN(__pci_window) = 0xf00000; . =
CYG_LABEL_DEFN(__pci_window) + 0x100000;
    SECTIONS_END
}

when I define ram : ORIGIN = 0x2e800000, LENGTH = 0x01800000, it
compiles successfully. however, ram is only 64MBs therefore it ends at
0x24000000. any ideas?

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]