Linker script, *.o, bss, etc.

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Linker script, *.o, bss, etc.

Postby notzed » Sun Aug 18, 2013 10:28 am

Is there any particular reason the linker script uses *.o to match files for processing the esdk-specific sections rather than simply *?

I ran into a surprise when I tried to use '.ec' and '.eo' to describe epiphany source code/objects so i could create a combined build environment using a single makefile and some implicit rules. But this broke all the section attributes (until i noticed it, and changed the linker script).

I'm talking about this:
.code_dram : {*.o(code_dram) *.o(.code_dram) } > EXTERNAL_DRAM_0
vs:
.code_dram : {*(code_dram) *(.code_dram) } > EXTERNAL_DRAM_0

Also I wanted to use bss sections for shared communication blocks but there wasn't any. Adding this after the .shared_dram line did it:

.bss.shared : {*(.bss.shared) } > EXTERNAL_DRAM_1

This still leaves the issue of address resolution on the ARM side, for now i'm using a script to extract the symbol locations, although it's something an elf loader could do.

The point of this is so i can use simple global variables and sections to define host-shared resources and let the linker do it's job, rather than manually linking base addresses in the code.

I have some other thoughts on e-hal, but i need to let them ferment a bit first.
notzed
 
Posts: 331
Joined: Mon Dec 17, 2012 12:28 am
Location: Australia

Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 60 guests