delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/07/06/08:27:49

Sender: root AT delorie DOT com
Message-ID: <3781F878.E2AE32B8@inti.gov.ar>
Date: Tue, 06 Jul 1999 09:37:12 -0300
From: salvador <salvador AT inti DOT gov DOT ar>
Organization: INTI
X-Mailer: Mozilla 4.6 [en] (X11; I; Linux 2.0.36 i686)
X-Accept-Language: es-AR, en, es
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp-workers AT delorie DOT com, Robert Hoehne <robert DOT hoehne AT gmx DOT net>,
Eric Rudd <rudd AT cyberoptics DOT com>
Subject: Re: .align directives in libc.a
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990704154148 DOT 13333G-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:

> On Thu, 1 Jul 1999, salvador wrote:
>
> > Can we tell Gas to use "int 3" (or other trap) when pading between functions?
>
> The alignment pseudo-ops allow to define the value of the byte with
> which to pad.  Thus, ".p2align 3,0xcc" should pad to 8-byte boundary
> with Int 3 instructions.
>
> But why is this a good idea?

To trap jumps in this space. Example: you have a corrupted pointer to function and
you jump to the gap between 2 functions. Using nops or things like movl %eax,%eax
you will enter in the next function so you:

1) Will lose information about the problem.
2) Call a function that could be dangerous.

That's all.

SET


--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
                    set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019