EmbDev.net

Forum: ARM programming with GCC/GNU tools arm-elf-gcc linker quirk, no text, data, or bss sections


Author: Jeremy D. (jezz)
Posted on:

Rate this post
0 useful
not useful
Hi,

I'm trying to get the arm-elf-gcc cross-compiler from GNUARM.org 
(2008-10-19) to generate a binary for me, however I get an empty binary 
file out of objdump. The best conclusion I can draw is that my linker 
command isn't working right.

The compiler generates the listings right, so I can only assume the 
objects are correct. Judging by the output of arm-elf-size, it looks 
like objdump is doing its job alright as well. Through arm-elf-size, I 
seem to be missing the data, text, and bss sections. These really ought 
be there.

I've posted my linker script (taken and lightly modified from 
at91sam7s_example_gamma) as well as what happens when I attempt to 
compile the executable to http://pastebin.com/d6c63a237.

To clarify two things, I intend to target the AT91SAM7SE256, however 
right now am just sticking to the AT91SAM7S512/AT91SAM7S-EK.

Can anyone help me out?

Thanks,
-Jeremy

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
Try a rebuild without compiler-options -ffunction-sections / 
-fdata-sections if this produces non-empty target sections you can just 
continue without these options.

If you what to keep the unused code removal feauture, add an ENTRY 
directive to the linker-script which "points" to the first instruction 
in the reset-code (same instruction that is called on a reset-exception.

Author: Jeremy D. (jezz)
Posted on:

Rate this post
0 useful
not useful
Hi,

The -ffunction-sections and -fdata-sections did the trick. It's good to 
know about the unused code removal points as well.

Thanks,
-Jeremy

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.