arm-elf-gcc linker quirk, no text, data, or bss sections

OP #1273364
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
Guest #1273541
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.

Reply

A question of your own? This thread is over 17 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.