This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: gas: .align padding
- Subject: Re: gas: .align padding
- From: "Andrew Morton" <morton at nortelnetworks dot com>
- Date: Fri, 15 Oct 1999 13:48:05 +0000
- CC: "binutils at sourceware dot cygnus dot com" <binutils at sourceware dot cygnus dot com>
- Organization: Nortel Networks, Wollongong Australia
- References: <Pine.LNX.4.10.9910152104440.30837-100000@mullet.itr.unisa.edu.au>
- Reply-To: akpm at bigfoot dot com
Alan Modra wrote:
>
> On Fri, 15 Oct 1999, Andrew Morton wrote:
>
> > Good morning. A few things:
> Good evening!
>
> > When padding .aligns gas seems to put random gunk into the object file
> > instead of nops or nulls. Can this be fixed?
> >
> > bix:~> cat t.s
> > nop
> > .align 8
> > nop
> >
> > bix:~> objdump --disassemble t.o
> >
> > t.o: file format elf32-i386
> >
> > Disassembly of section .text:
> >
> > 00000000 <.text>:
> > 0: 90 nop
> > 1: 8d b4 26 00 00 00 00 leal 0x0(%esi,1),%esi
> > 8: 90 nop
>
> That's not random gunk! That's a 7 byte nop.
Oh I see. Thanks.
Care to quench my curiosity as to why this was done??
>
> Use ".align 8,0x90" if you want single byte nops.
Not an option, I'm afraid. This is gcc output.
I'm exploring the possibility of writing a full disassembler; that is,
one whose output can be reassembled. The idea being that this can be
used to add instrumentation to existing object files. Disassemble,
massage, reassemble. I'm currently at the "is this remotely possible"
stage.
I was concerned that the "random gunk" would cause problems, but
deliberate gunk is just fine.
- Andrew.