grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] NetBSD/i386 port


From: Marco Gerards
Subject: Re: [PATCH] NetBSD/i386 port
Date: Thu, 01 Dec 2005 19:39:05 +0100
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Hollis Blanchard <address@hidden> writes:

> On Dec 1, 2005, at 7:48 AM, Marco Gerards wrote:
>>> Files affected: kern/mm.c, normal/misc.c
>>>
>>> This is probably more a gcc issue (my is gcc version 3.3.3 (NetBSD nb3
>>> 20040520)). As of 2.0, NetBSD/i386 uses non-executable mapping of
>>> stack
>>> and thus when nested functions are used it generates call to
>>> __enable_execute_stack() (which is actually in libgcc) even if
>>> -nostdlib
>>> is used. Since I know no way to disable this behavior (but there
>>> might be
>>> some) only workaround known to me is providing dumb
>>> __enable_execute_stack()
>>> functions where apropriate.
>>
>> When is this required?  When using grub-emu or any other userland
>> utility?  In that case GRUB is linked to the C library.
>>
>> In the case it is used for GRUB itself, it is useless.  GRUB executes
>> within its own environment.  So in that case we should just make sure
>> this doesn't show up.  Perhaps by using different compiler flags.
>
> I think this is a problem Peter Jones was telling me about with Fedora
> as well (non-executable stack conflicting with nested functions).
>
> Peter, do you know anything about that __enable_execute_stack()?
> http://gcc.gnu.org/ml/gcc-patches/2004-07/msg01700.html seems to
> indicate it's only for Solaris, NetBSD, FreeBSD/SPARC64 and OSF, but
> it sounds like we need it on Linux as well?

In that case we only need it in util/, I assume?  I wonder if it is
possible to check this using autoconf and add it to util/misc.c in
some initialization function (that yet has to be written).

I was told that -ftrampolines might fix our problem, so looking at
that flag might be useful.

--
Marco





reply via email to

[Prev in Thread] Current Thread [Next in Thread]