This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: V850, linker script problem


Hi,

i rearragned the sections in the linker script and by that
the problem disappeared.

I know that the order of sections matters, but the problem
here was not obvious to me and i can't really explain it.

Previously the order was (not all sections shown):
.text
.call_table_data
.call_table_text
.fini
.rodata
.rodata1
.data
.data1
.ctors
.dtors
.jcr
.gcc_except_table
.got
.dynamic
.tdata
.sdata
.rosdata

Now it is:
.text
.call_table_data
.call_table_text
.data
.data1
.sdata
.tdata
.ctors             #
.dtors             #
.gcc_except_table  #
.got               #
.dynamic
.sbss

Basically, i moved .tdata and .sdata before the sections marked with '#'.


As there is no overview of all sections available, i copied
all section names from the original V850 linker script and put
my assumptions in front of it.

I wonder why all the rela.* and rel.* get merged into the
text segment in the original.

I was searching for some of the sections with google but did
not really find an answer.

It would be great if anybody could give me a hint on where to
place the sections in the target, especially .dynamic .


RAM .zdata
ROM .rozdata
ROM .interp
ROM .hash
ROM .dynsym
ROM .dynstr
ROM .rel.text
ROM .rela.text
ROM .rel.data
ROM .rela.data
ROM .rel.rodata
ROM .rela.rodata
ROM .rel.gcc_except_table
ROM .rela.gcc_except_table
ROM .rel.got
ROM .rela.got
ROM .rel.ctors
ROM .rela.ctors
ROM .rel.dtors
ROM .rela.dtors
ROM .rel.init
ROM .rela.init
ROM .rel.fini
ROM .rela.fini
ROM .rel.bss
ROM .rela.bss
ROM .rel.plt
ROM .rela.plt
ROM .init
ROM .plt
ROM .text
ROM .call_table_data
ROM .call_table_text
ROM .fini
ROM .rodata
ROM .rodata1
RAM>ROM .data
RAM>ROM .data1
ROM .ctors
ROM .dtors
ROM .jcr
ROM .gcc_except_table
ROM .got
??? .dynamic
RAM>ROM .tdata
RAM>ROM .sdata
ROM .rosdata
RAM .sbss
RAM .bss


DEBUG .stab
DEBUG .stabstr
DEBUG .stab.excl
DEBUG .stab.exclstr
DEBUG .stab.index
DEBUG .stab.indexstr
DEBUG .comment
DEBUG .debug
DEBUG .line
DEBUG .debug_srcinfo
DEBUG .debug_sfnames
DEBUG .debug_aranges
DEBUG .debug_pubnames
DEBUG .debug_info
DEBUG .debug_abbrev
DEBUG .debug_line
DEBUG .debug_frame
DEBUG .debug_str
DEBUG .debug_loc
DEBUG .debug_macinfo
DEBUG .debug_weaknames
DEBUG .debug_funcnames
DEBUG .debug_typenames
DEBUG .debug_varnames

RAM .stack

Basically, i think i need to clear all RAM sections and
copy all RAM>ROM sections from ROM to RAM.  Is that correct?


Erik, is the test below still needed?


Thanks for any hints,
Torsten.



> > I added another section for testing:
> >
> >   .myqwe :
> >   {
> >     *(.myqwe)
> >   } > ram AT > rom
> >
> > in vectors.S:
> >         .section .myqwe,"w"
> > 	.string "abcdefg"
> >
> > It leads to exactly the behaviour i expect:
> >
> > .myqwe          0x03ffe000        0x8 load address 0x00000678
> >  *(.myqwe)
> >  .myqwe         0x03ffe000        0x8 vectors.o
> >
> > I wonder why defining the sections the same way does not work
> > for ".sdata" and for ".tdata".
>
> A clue might be found in linking with something like:
>
> LDFLAGS = -L /usr/local/lib/gcc/v850e/4.0.2/ -lc -lgcc
> v850-ld -verbose -T your_linker_script -o test.elf your_object_files \
>         $(LDFLAGS) -M > test.map
>
>  (N.B. You're maybe not using gcc 4.0.2)
>
> Allowing gcc to intrude into the linking process is a variable not fully
> in your control. The above works for me, using the alternative "AT"
> syntax in the linker script.
>
> > C:
> > The sections .sdata and .tdata are empty, but also when i add
> > some data to it it results in the same error message.
>
> What happens if you rename these output sections elephant and zebra?
> (The only consequential changes should be any linker script lines which
> use ADDR or LOADADDR of these sections.)
>
> Erik


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