From a81c7a7cd665b6e679117ad2bdf27894bed16d82 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Wed, 27 Sep 2006 14:38:42 -0700 Subject: [PATCH] PackBSDI386 clarify osabi issues. --- src/p_lx_exc.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/p_lx_exc.cpp b/src/p_lx_exc.cpp index 2c544b23..4475144f 100644 --- a/src/p_lx_exc.cpp +++ b/src/p_lx_exc.cpp @@ -61,7 +61,16 @@ PackLinuxI386::PackLinuxI386(InputFile *f) : super(f), PackBSDI386::PackBSDI386(InputFile *f) : super(f) { - ei_osabi = 0; // not ELFOSABI_LINUX + // Shell scripts need help specifying the target operating system. + // Elf input will override this with .e_ident[EI_OSABI] or PT_NOTE. + // [2006-09-27: Today's only runtime stub for shell is for linux.] + if (Elf32_Ehdr::ELFOSABI_LINUX==opt->o_unix.osabi0) { + // Disallow an incompatibility. + ei_osabi = Elf32_Ehdr::ELFOSABI_NONE; + } + else { + ei_osabi = opt->o_unix.osabi0; // might be ELFOSABI_NONE + } } static const