[apologies for the empty mail earlier; wetware error]
RFC: Deprecate a.out ELF interpreter support
The Linux ELF loader is quite complicated and messy code (that could
probably need a rewrite, but that's a different chapter). One particular
messy part in it is the support for non ELF a.out ld.sos. This
was originally added to make transition from a.out to ELF easier
because an a.out ELF ld.so could be still build using an older
a.out toolkit. But by now that should be fully obsolete and removing
it would clean up binfmt_elf.c up a bit.
I propose to deprecate this support and remove for 2.6.25.
Drawback is that someone still runs their system with a.out ld.so
they would need to update the ld.so when updating to a new kernel.
This patch just adds an entry to the deprecation file and a printk
warning users.
Comments?
Signed-off-by: Andi Kleen <[email protected]>
Index: linux-2.6.23-rc1-misc/Documentation/feature-removal-schedule.txt
===================================================================
--- linux-2.6.23-rc1-misc.orig/Documentation/feature-removal-schedule.txt
+++ linux-2.6.23-rc1-misc/Documentation/feature-removal-schedule.txt
@@ -306,3 +306,12 @@ Why: All mthca hardware also supports MS
Who: Roland Dreier <[email protected]>
---------------------------
+
+What: a.out interpreter support for ELF executables
+When: 2.6.25
+Files: fs/binfmt_elf.c
+Why: Using a.out interpreters for ELF executables was a feature for
+ transition from a.out to ELF. But now it is unlikely to be still
+ needed anymore and removing it would simplify the hairy ELF
+ loader code.
+Who: Andi Kleen <[email protected]>
Index: linux-2.6.23-rc1-misc/fs/binfmt_elf.c
===================================================================
--- linux-2.6.23-rc1-misc.orig/fs/binfmt_elf.c
+++ linux-2.6.23-rc1-misc/fs/binfmt_elf.c
@@ -730,6 +730,7 @@ static int load_elf_binary(struct linux_
/* Some simple consistency checks for the interpreter */
if (elf_interpreter) {
+ static int warn;
interpreter_type = INTERPRETER_ELF | INTERPRETER_AOUT;
/* Now figure out which format our binary is */
@@ -741,6 +742,12 @@ static int load_elf_binary(struct linux_
if (memcmp(loc->interp_elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
interpreter_type &= ~INTERPRETER_ELF;
+ if (interpreter_type == INTERPRETER_AOUT && warn < 10) {
+ printk(KERN_WARNING "a.out ELF interpreter %s is "
+ "deprecated and will not be supported anymore\n", elf_interpreter);
+ warn++;
+ }
+
retval = -ELIBBAD;
if (!interpreter_type)
goto out_free_dentry;
Andi Kleen wrote:
>
> I propose to deprecate this support and remove for 2.6.25.
>
> Drawback is that someone still runs their system with a.out ld.so
> they would need to update the ld.so when updating to a new kernel.
>
> This patch just adds an entry to the deprecation file and a printk
> warning users.
>
> Comments?
>
Makes total sense. This is a highly oddball configuration, and
*extremely* unlikely to have a significant user base of modern kernels.
It's been 12 years since we switched to ELF.
-hpa
On Aug 1 2007 14:33, Andi Kleen wrote:
>Comments?
A kconfig entry "(OBSOLETE)"/"(DEPRECATED)" would be nice.
(And if you want to test people, 'depends on EMBEDDED' for CONFIG_BINFMT_AOUT)
Jan
--
On Wednesday 01 August 2007 20:30:18 Jan Engelhardt wrote:
>
> On Aug 1 2007 14:33, Andi Kleen wrote:
> >Comments?
>
> A kconfig entry "(OBSOLETE)"/"(DEPRECATED)" would be nice.
> (And if you want to test people, 'depends on EMBEDDED' for CONFIG_BINFMT_AOUT)
The point is to have less clutter in binfmt_elf.c (which really
could need a rewrite btw or at least a lot of cleanup) not add more in form
of ifdefs.
-Andi
On Aug 1 2007 20:35, Andi Kleen wrote:
>> On Aug 1 2007 14:33, Andi Kleen wrote:
>> >Comments?
>>
>> A kconfig entry "(OBSOLETE)"/"(DEPRECATED)" would be nice.
>> (And if you want to test people, 'depends on EMBEDDED' for CONFIG_BINFMT_AOUT)
>
>The point is to have less clutter in binfmt_elf.c (which really
>could need a rewrite btw or at least a lot of cleanup) not add more in form
>of ifdefs.
---
fs/Kconfig.binfmt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.23/fs/Kconfig.binfmt
===================================================================
--- linux-2.6.23.orig/fs/Kconfig.binfmt
+++ linux-2.6.23/fs/Kconfig.binfmt
@@ -56,7 +56,7 @@ config BINFMT_SHARED_FLAT
Support FLAT shared libraries
config BINFMT_AOUT
- tristate "Kernel support for a.out and ECOFF binaries"
+ tristate "Kernel support for a.out and ECOFF binaries (OBSOLETE)"
depends on X86_32 || ALPHA || ARM || M68K || SPARC32
---help---
A.out (Assembler.OUTput) is a set of formats for libraries and
Plusminus "depends on EMBEDDED" to already hide it in the short term until
removal. (Yes, ideally, one would use the yet-to-be-introduced CONFIG_OBSOLETE)
Jan
--
On Wed, Aug 01, 2007 at 09:26:10PM +0200, Jan Engelhardt wrote:
>
> On Aug 1 2007 20:35, Andi Kleen wrote:
> >> On Aug 1 2007 14:33, Andi Kleen wrote:
> >> >Comments?
> >>
> >> A kconfig entry "(OBSOLETE)"/"(DEPRECATED)" would be nice.
> >> (And if you want to test people, 'depends on EMBEDDED' for CONFIG_BINFMT_AOUT)
> >
> >The point is to have less clutter in binfmt_elf.c (which really
> >could need a rewrite btw or at least a lot of cleanup) not add more in form
> >of ifdefs.
>
>
> ---
> fs/Kconfig.binfmt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6.23/fs/Kconfig.binfmt
> ===================================================================
> --- linux-2.6.23.orig/fs/Kconfig.binfmt
> +++ linux-2.6.23/fs/Kconfig.binfmt
> @@ -56,7 +56,7 @@ config BINFMT_SHARED_FLAT
> Support FLAT shared libraries
>
> config BINFMT_AOUT
> - tristate "Kernel support for a.out and ECOFF binaries"
> + tristate "Kernel support for a.out and ECOFF binaries (OBSOLETE)"
NAK, binfmt a.out support is something entirely different from what
we're talking about here.
> config BINFMT_AOUT
> - tristate "Kernel support for a.out and ECOFF binaries"
> + tristate "Kernel support for a.out and ECOFF binaries (OBSOLETE)"
I'm _NOT_ proposing to obsolete a.out support. Just a.out ld.so support for ELF
executables. The relevant code is in binfmt_elf.c
-Andi
On Wed, 1 Aug 2007, Jan Engelhardt wrote:
> config BINFMT_AOUT
> - tristate "Kernel support for a.out and ECOFF binaries"
> + tristate "Kernel support for a.out and ECOFF binaries (OBSOLETE)"
I beg your pardon?! This definitely is not what Andi meant, right? We want
to remove the legacy support for a.out ELF-interpreters, not a.out
binaries.
--
Jiri Kosina
On 08/01/2007 08:30 PM, Jan Engelhardt wrote:
> On Aug 1 2007 14:33, Andi Kleen wrote:
>> Comments?
>
> A kconfig entry "(OBSOLETE)"/"(DEPRECATED)" would be nice. (And if you
> want to test people, 'depends on EMBEDDED' for CONFIG_BINFMT_AOUT)
Or just remove that junk.
Rene.