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

Author: Andrew (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi everyone,

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

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

Where is problem?

PS. Sorry for my english:)

Author: Stefan (Guest)
Posted on:

Rate this post
0 useful
not useful
From the objcopy manual

"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.

Author: Andrew (Guest)
Posted on:

Rate this post
0 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:)


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.