Sections padding "*fill*" in .map

OP #1173712
After compiling and linking I get an ouput map file.  I there there is a
bunch of fill that take up room in memory.  I found that objcopy has
an option --gap-fill which allows you to select what to fill in these
gaps with.  I was wondering if there is any way to eliminate these gaps
altogether? i.e. remove section padding or something like that.

Thanks.
They only take up unused memory. The gaps will be determined by the
alignment and location of sections defined in your linker script. So you
would need to modify teh script to close the gaps. Filling with 0xFF
will mean that the memory won't need to be programmed (since 0xFF is the
Flash erase state), on the other hand filling with 0x00 means that the
memory cannot be re-programmed without erasing, which may be more
secure.

Typically you might want to program the entire flash memory even if only
a part of it is used. objcopy can create a load file that exactly fits
your devices flash memory even though your code is unlikely to do so.

In short I think you are worrying about nothing - if you application
fits, that is.

Clifford

Reply

A question of your own? This thread is over 18 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.