[U-Boot] [SOT] linker scripts

Jason u-boot at lakedaemon.net
Thu Apr 26 06:16:24 CEST 2012


All,

I know this is a little off topic, but u-boot is the only project I've
found implementing a feature I'd like to add to a project.
Specifically, the macro U_BOOT_CMD() and it's use of
section(".u_boot_cmd").

I'd like to implement something similar in a userspace C program, but I
can't get it to work.  A lot of my searches on the net for my various
errors leads me to believe I should let gcc do the linking and not mess
with ld.

I've gotten to the point where it compiles cleanly, but then I get 'No
such file or directory" from bash when trying to run the resulting
executable.  (Using ld)

Is there a succinct way to use the modified output of 'ld -v' from gcc
so that I can place the array of structs between _blah_start and
_blah_end?

I've tried 'gcc -Wl,-T,mylink.lds -Wl,-u_blah_thisone ...' and that
compiles fine, and runs, but there is no struct found when I iterate
from _blah_start to _blah_end. The output of 'strings a.out | grep
_blah' gives only _blah_end.  I'm a bit out of my depth here.  Any help
appreciated.

thx,

Jason.


More information about the U-Boot mailing list