EmbDev.net

Forum: ARM programming with GCC/GNU tools WinARM. Create bin-file problem


von Andrew (Guest)


Rate this post
useful
not useful
Hi everyone,

When i try to create binary file, its size 512M, but it must be about
12K.

I do this:
   arm-elf-objcopy -O binary myfile.elf myfile.bin

Where is problem?
Thanks.

PS. Sorry for my english:)

von Stefan (Guest)


Rate this post
useful
not useful
From the objcopy manual
http://www.gnu.org/software/binutils/manual/html_chapter/binutils_3.html

"objcopy can be used to generate a raw binary file by using an output
target of `binary' (e.g., use `-O binary'). When objcopy generates a raw
binary file, it will essentially produce a memory dump of the contents
of the input object file. All symbols and relocation information will be
discarded. The memory dump will start at the load address of the lowest
section copied into the output file.

When generating an S-record or a raw binary file, it may be helpful to
use `-S' to remove sections containing debugging information. In some
cases `-R' will be useful to remove sections which contain information
that is not needed by the binary file."

1/ Check your source (assembler listing, linker control script) for the
lowest load address and the highest load address. Seems there is a 512
MB address space used.

2/ Try the -S and the -R options.

von Andrew (Guest)


Rate this post
useful
not useful
Thanks, Stefan.

Looks like problem is in my code.

When i remove any function from my source code, i get correct code size.
When code size reach some limit, linker insert some variable at address
0x0. (i work with str7 microcontroller which have rom at 0x40000000).

Possible, its because friday evening:)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.