Trouble eliminating padding or alignments

Alan Modra amodra@gmail.com
Fri Jul 16 06:38:00 GMT 2010


On Thu, Jul 15, 2010 at 04:27:14PM +0100, Alex Buell wrote:
> How can I eliminate these *fill* bytes?

By not aligning the following section.

> Is the linker intelligent enough
> to discard routines that aren't referenced? 

Yes.  Use -gc-sections and compile with gcc -ffunction-sections
-fdata-sections.  If this is assembly code, put each function in a
separate section, usually named .text.function_name.  (You can see
what to do by looking at the output of gcc -ffunction-sections
-fdata-sections -S.)

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list