This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Removal of GCC/GAS tailing .code segment NOP padding ?
- From: "Darryl L. Miles" <darryl-mailinglists at netbauds dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 22 Nov 2006 09:21:10 +0000
- Subject: Removal of GCC/GAS tailing .code segment NOP padding ?
I have a piece of C code which has inline assembler __asm__
__volatile__(...) on Intel IA32. This is the only function and C file
and in the resulting object code.
When comparing the resulting object code to that generated by the system
compiler/assembler to that generated by GCC, I find that GCC has
inserted trailing NOP opcodes to pad the .code segment out to GCCs
alignment policy.
Is it possible to make GCC emit a .code segment without add any trailing
NOP instructions to pad the end ? Note this is a different requirement
to wanting to remove the function start alignment padding, if my code
has two functions in I'd like to keep that padding but just remove the
trailing padding in the .code segment.
My project is made up of a lot of files with small .code units in each
and I'd like to leave the linker free to manage alignment requirements
when building the resulting executable rather than force it to treat the
.code segment as-is and include all that trailing padding which feels
the wrong way to do things IMHO.
Darryl