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]

Specific location for kernel_mutex.o : linker file issue. Need help !


Hi,

My problem is simple. I want to locate the.text section of the
kernel_mutex.o object (archived in libtarget.a)ina special ram location
which I call "iram".
This is a 16kbytes fast ram region, which I want to use as much as
possible.
I'vealready located my interrupt stack there, and I want to put in the
mostused code too. I will start with kernel_mutex, and fill it later
withother objects. The rest of the code and data will be located in
aregular (slower) sdram.
I though I could do this in a blink of an eye by patching targed.ld this
way (see the ".iram" line)

STARTUP(vectors.o)
ENTRY(reset_vector)
INPUT(extras.o)

GROUP(libtarget.a libgcc.a libsupc++.a)
MEMORY
{??? ram : ORIGIN = 0, LENGTH = 0x00200000?? iram : ORIGIN = 0x00200000,
LENGTH = 0x00004000?? flash : ORIGIN = 0x92000000, LENGTH = 0x100000
}

SECTIONS
{???.debug_aranges 0 : { *(.debug_aranges) } .debug_pubnames 0 :
{*(.debug_pubnames) } .debug_info 0 : { *(.debug_info) } .debug_abbrev 0: {
*(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame0 : {
*(.debug_frame) } .debug_str 0 : { *(.debug_str) } .debug_loc 0 :{
*(.debug_loc) } .debug_macinfo 0 : { *(.debug_macinfo) }.note.arm.ident 0 :
{ KEEP (*(.note.arm.ident)) }??? .fixed_vectors 0x20 : { . = .; KEEP
(*(.fixed_vectors)) } > ram???.rom_vectors 0x000300 : { __rom_vectors_vma =
ABSOLUTE(.); . = .; KEEP(*(.vectors)) } > ram __rom_vectors_lma =
LOADADDR(.rom_vectors);???.text ALIGN (0x4) : { _stext = ABSOLUTE(.);
PROVIDE (__stext =ABSOLUTE(.)); *(.text*) *(.gnu.warning)
*(.gnu.linkonce.t.*) *(.init)*(.glue_7) *(.glue_7t) } > ram _etext = .;
PROVIDE (__etext = .);??? .fini ALIGN (0x4) : { . = .; *(.fini) } > ram
.rodata ALIGN (0x4) : { . = .; *(.rodata*) *(.gnu.linkonce.r.*) } > ram
.rodata1 ALIGN (0x4) : { . = .; *(.rodata1) } > ram??? .fixup ALIGN (0x4) :
{ . = .; *(.fixup) } > ram??? .gcc_except_table ALIGN (0x4) : { . = .;
*(.gcc_except_table) } > ram???.data ALIGN (0x4) : { __ram_data_start =
ABSOLUTE (.); *(.data*)*(.data1) *(.gnu.linkonce.d.*) . = ALIGN (4);
KEEP(*( SORT(.ecos.table.*))) ; . = ALIGN (4); __CTOR_LIST__ = ABSOLUTE
(.); KEEP(*(SORT (.ctors*))) __CTOR_END__ = ABSOLUTE (.); __DTOR_LIST__
=ABSOLUTE (.); KEEP (*(SORT (.dtors*))) __DTOR_END__ = ABSOLUTE
(.);*(.dynamic) *(.sdata*) *(.gnu.linkonce.s.*) . = ALIGN (4); *(.2ram.*)
}> ram __rom_data_start = LOADADDR (.data); __ram_data_end = .;PROVIDE
(__ram_data_end = .); _edata = .; PROVIDE (edata = .);
PROVIDE(__rom_data_end = LOADADDR (.data) + SIZEOF(.data));??? .bss0x120000
: { __bss_start = ABSOLUTE (.); *(.scommon) *(.dynsbss)*(.sbss*)
*(.gnu.linkonce.sb.*) *(.dynbss) *(.bss*)*(.gnu.linkonce.b.*) *(COMMON)
__bss_end = ABSOLUTE (.); } > ram??? __heap1 = ALIGN (0x8);??? .iram
0x200000 : { . = .; *(.iram*); kernel_mutex.o(.text) } > iram
??? . = ALIGN(4); _end = .; PROVIDE (end = .);
}
Butwhen compiling the tests I get an error. It seems that the linker cannot
extract kernel_mutex.o object file from libtarget.a to
get its.text section to put in my .iram region. I tried several
variants,specifying INPUT(libtarget.a), or INPUT(kernel_mutex.o),
with nosuccess. It works if I try to do the thing with an object file which
isnot archived in libtarget.a (extras.o for example).

using arm-elf-ar, I can see that libtarget.a contains kernel_mutex.o.

I'm sure it is possible to do this. I tried the all afternoon. I must miss
something. Please help !!!

Below is the error I get.
make -r -C kernel/current tests
make[1]: Entering directory
`/ecos-e/prj/eCos_version/ARM/with_iram_build/kernel/current'
arm-elf-gcc-L/ecos-e/prj/eCos_version/ARM/with_iram_install/lib -Ttarget.ld
-o/ecos-e/prj/eCos_version/ARM/with_iram_install/tests/kernel/current/tests/bin_sem0tests/bin_sem0.o
 --no-target-default-spec -Wl,--gc-sections -Wl,-static-g -nostdlib
arm-elf-gcc-L/ecos-e/prj/eCos_version/ARM/with_iram_install/lib -Ttarget.ld
-o/ecos-e/prj/eCos_version/ARM/with_iram_install/tests/kernel/current/tests/bin_sem1tests/bin_sem1.o
 --no-target-default-spec -Wl,--gc-sections -Wl,-static-g -nostdlib
/ecos-e/prj/GNUARM/bin/../lib/gcc/arm-elf/3.4.3/../../../../arm-elf/bin/ld:
cannot find kernel_mutex.o
make[1]: Leaving directory
`/ecos-e/prj/eCos_version/ARM/with_iram_build/kernel/current'
collect2: ld returned 1 exit status
make: Leaving directory `/ecos-e/prj/eCos_version/ARM/with_iram_build'
/ecos-e/prj/GNUARM/bin/../lib/gcc/arm-elf/3.4.3/../../../../arm-elf/bin/ld:
cannot find kernel_mutex.o
collect2: ld returned 1 exit status
make[1]: ***
[/ecos-e/prj/eCos_version/ARM/with_iram_install/tests/kernel/current/tests/bin_sem0]
 Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: ***
[/ecos-e/prj/eCos_version/ARM/with_iram_install/tests/kernel/current/tests/bin_sem1]
 Error 1
make: *** [tests] Error 2


--
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]