Hello,
I just changed from nasm to the gnu assembler and I wonder how to tell him, that I want to fill up the section until address 0x1FE with NOPs (0x90)? If I use ".align 510, 0x90" he argues there is no power of 2... And in the manual I don't see any possibility to get the current address (by the way: would be useful to know. The '$' dosn't work with the AT&T syntax)
best regards
sebihepp
gas fill section with NOPs
-
- Member
- Posts: 184
- Joined: Tue Aug 26, 2008 11:24 am
- GitHub: https://github.com/sebihepp
- xenos
- Member
- Posts: 1118
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: gas fill section with NOPs
The first argument of .align specifies an alignment, which must be a power of two. It does not specify the upper limit address. I guess .space (510 - .), 0x90 should do what you want.
Instead of the "$" symbol, gas uses the "." for the current address: http://sourceware.org/binutils/docs-2.21/as/Dot.html
Instead of the "$" symbol, gas uses the "." for the current address: http://sourceware.org/binutils/docs-2.21/as/Dot.html
-
- Member
- Posts: 184
- Joined: Tue Aug 26, 2008 11:24 am
- GitHub: https://github.com/sebihepp
Re: gas fill section with NOPs
Many thousand thanks. The dot "." is what I was looking for.
But it didn't work, because .space needs an absolute value or expression...
But it didn't work, because .space needs an absolute value or expression...
- xenos
- Member
- Posts: 1118
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: gas fill section with NOPs
Hm... In that case you could try .org 510, 0x90 instead: http://sourceware.org/binutils/docs-2.21/as/Org.html