From: m_hrebien@wp.pl
To: linux-assembly@vger.kernel.org
Subject: Re: gas' nop(s)
Date: Mon, 05 Aug 2002 19:53:41 +0200 [thread overview]
Message-ID: <3D4EBBA5.698AA14D@wp.pl> (raw)
In-Reply-To: 20020805102040.7d12bd33.*@lxhp.in-berlin.de
h-peter recktenwald wrote:
>
> > Hi there,
> >
> > did You noticed that GNU as adds some padding nop(s) like:
> >
> > lea (%esi),%esi
> > mov %esi,%esi
> > nop
> >
> > at the end of .text section? Is this really necessary? The .text section
> > mustn't be padded to 4 like it seems to be or am i wrong? How can i
> > avoid this? Is there any gas option to switch this off?
>
> some time back, i tried AS as an intermediate program, w. piped i/o, and
> encountered the same problem, which i didn't manage to solve, too. there
> is no option + no other idea. those gods of gnu binutils devel might know
> but, i myself never received an answer to any AS related question...
>
> anyway, AS wsn't meant to do plain, stand alone assembly but is designed
> to produceing a set of data which can be combined to something, probably
> executeable, with the "ld" linker.
Yes, it's gcc's back-end rather then stand alone assembler.
> so the implicite alignment might even
> be very helpful for faster processing.
>
> i'd (highly) recommend the "fasm" assembler for the more 'direct' work:)
> http://fasm.metro-nt.pl/
:) Thanks, i'll check it...
> > Sorry if this topic is doubled by me but i couldn't find something
> > similar in the archive :(
Guess what? I've tried this .align directive as Jani Monoses suggested
like this:
.text
.align 1
.globl _start
_start:
mov $1,%eax
xor %ebx,%ebx
int $0x80
and it's not working as i wish - gas adds lea (%esi),%esi after int
$0x80 to the output :( I've tried with 2, 4, 8 & 16 and it seems that
.align x works good if x is greater equal than 4 :( But why??
--
Maciej Hrebien
next prev parent reply other threads:[~2002-08-05 17:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-04 20:28 gas' nop(s) m_hrebien
[not found] ` <20020805091651.245c7d4b.jani@iv.ro>
2002-08-05 9:23 ` m_hrebien
2002-08-05 10:20 ` h-peter recktenwald
2002-08-05 17:53 ` m_hrebien [this message]
2002-08-05 22:21 ` h-peter recktenwald
2002-08-06 9:30 ` m_hrebien
2002-08-07 7:41 ` h-peter recktenwald
2002-08-08 15:50 ` h-peter recktenwald
2002-08-09 16:07 ` h-peter recktenwald
2002-08-09 19:47 ` Maciej Hrebien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D4EBBA5.698AA14D@wp.pl \
--to=m_hrebien@wp.pl \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).