grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Handle C symbols with leading underscore (HAVE_ASM_USCORE)


From: Robert Millan
Subject: Re: [PATCH] Handle C symbols with leading underscore (HAVE_ASM_USCORE)
Date: Sun, 18 Nov 2007 07:18:41 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Sun, Nov 11, 2007 at 07:24:52PM +0100, Christian Franke wrote:
> 
> Should the kernel probably check whether a module is build for the same 
> target? This would avoid interesting behaviour if a foreign module is 
> accidentally load for some reason. It could e.g. be done by checking a 
> symbol derived from $target.

It's important to keep the kernel small.  IMHO checks against improper use
themselves don't justify increasing its size (although what you want might
fit well in grub-mkimage, at least for modules that are put in core.img).

OTOH, there's an ongoing discussion on how to embed a filesystem image as
part of core.img, which (maybe, I'm not sure ;-)) could qualify as "foreign
module" and somehow collide with this.  Thread subject is:
"Re: grub-setup: error: Non-sector-aligned data is found in the core file"

> diff -rup grub2.orig/kern/dl.c grub2/kern/dl.c
> --- grub2.orig/kern/dl.c      2007-07-22 01:32:26.000000000 +0200
> +++ grub2/kern/dl.c   2007-11-11 18:01:50.578125000 +0100
> @@ -53,6 +53,12 @@ typedef Elf64_Sym Elf_Sym;
>  
>  #endif
>  
> +#ifdef HAVE_ASM_USCORE
> +# define SYM_USCORE "_"
> +#else
> +# define SYM_USCORE ""
> +#endif

Should this be global?  We already have START_SYMBOL and END_SYMBOL.  Perhaps
this should be next to them?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)




reply via email to

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