Add support for glibc consumers using the new ld-linux.so.2 linker.
I can't say this was the most inspired fix, but it matches the design OK.
This commit is contained in:
parent
5fb94b7685
commit
23bdbca2d4
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux.c,v 1.11 1997/04/06 10:47:59 dufault Exp $
|
||||
* $Id: linux.c,v 1.12 1997/05/01 06:08:14 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -41,12 +41,13 @@ extern const struct execsw linux_execsw;
|
||||
|
||||
MOD_EXEC(linux, -1, &linux_execsw);
|
||||
|
||||
extern Elf32_Brandinfo linux_brand;
|
||||
extern Elf32_Brandinfo linux_brand, linux_glibc2brand;
|
||||
|
||||
static int
|
||||
linux_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
if (elf_insert_brand_entry(&linux_brand))
|
||||
if ((elf_insert_brand_entry(&linux_brand)) ||
|
||||
(elf_insert_brand_entry(&linux_glibc2brand)))
|
||||
uprintf("Could not install ELF interpreter entry\n");
|
||||
/* uprintf("Linux emulator installed\n"); XXX - shut up, you! */
|
||||
return 0;
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux_sysvec.c,v 1.32 1998/08/16 01:21:50 bde Exp $
|
||||
* $Id: linux_sysvec.c,v 1.33 1998/09/14 05:36:48 jdp Exp $
|
||||
*/
|
||||
|
||||
/* XXX we use functions that might not exist. */
|
||||
@ -434,6 +434,13 @@ Elf32_Brandinfo linux_brand = {
|
||||
&elf_linux_sysvec
|
||||
};
|
||||
|
||||
Elf32_Brandinfo linux_glibc2brand = {
|
||||
"Linux",
|
||||
"/compat/linux",
|
||||
"/lib/ld-linux.so.2",
|
||||
&elf_linux_sysvec
|
||||
};
|
||||
|
||||
#ifndef LKM
|
||||
/*
|
||||
* XXX: this is WRONG, it needs to be SI_SUB_EXEC, but this is just at the
|
||||
@ -445,7 +452,8 @@ static void
|
||||
linux_elf_init(dummy)
|
||||
void *dummy;
|
||||
{
|
||||
if (elf_insert_brand_entry(&linux_brand) < 0)
|
||||
if ((elf_insert_brand_entry(&linux_brand) < 0) ||
|
||||
(elf_insert_brand_entry(&linux_glibc2brand) < 0))
|
||||
printf("cannot insert Linux elf brand handler\n");
|
||||
else if (bootverbose)
|
||||
printf("Linux-ELF exec handler installed\n");
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux_sysvec.c,v 1.32 1998/08/16 01:21:50 bde Exp $
|
||||
* $Id: linux_sysvec.c,v 1.33 1998/09/14 05:36:48 jdp Exp $
|
||||
*/
|
||||
|
||||
/* XXX we use functions that might not exist. */
|
||||
@ -434,6 +434,13 @@ Elf32_Brandinfo linux_brand = {
|
||||
&elf_linux_sysvec
|
||||
};
|
||||
|
||||
Elf32_Brandinfo linux_glibc2brand = {
|
||||
"Linux",
|
||||
"/compat/linux",
|
||||
"/lib/ld-linux.so.2",
|
||||
&elf_linux_sysvec
|
||||
};
|
||||
|
||||
#ifndef LKM
|
||||
/*
|
||||
* XXX: this is WRONG, it needs to be SI_SUB_EXEC, but this is just at the
|
||||
@ -445,7 +452,8 @@ static void
|
||||
linux_elf_init(dummy)
|
||||
void *dummy;
|
||||
{
|
||||
if (elf_insert_brand_entry(&linux_brand) < 0)
|
||||
if ((elf_insert_brand_entry(&linux_brand) < 0) ||
|
||||
(elf_insert_brand_entry(&linux_glibc2brand) < 0))
|
||||
printf("cannot insert Linux elf brand handler\n");
|
||||
else if (bootverbose)
|
||||
printf("Linux-ELF exec handler installed\n");
|
||||
|
@ -25,7 +25,7 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: linux.c,v 1.11 1997/04/06 10:47:59 dufault Exp $
|
||||
* $Id: linux.c,v 1.12 1997/05/01 06:08:14 jkh Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -41,12 +41,13 @@ extern const struct execsw linux_execsw;
|
||||
|
||||
MOD_EXEC(linux, -1, &linux_execsw);
|
||||
|
||||
extern Elf32_Brandinfo linux_brand;
|
||||
extern Elf32_Brandinfo linux_brand, linux_glibc2brand;
|
||||
|
||||
static int
|
||||
linux_load(struct lkm_table *lkmtp, int cmd)
|
||||
{
|
||||
if (elf_insert_brand_entry(&linux_brand))
|
||||
if ((elf_insert_brand_entry(&linux_brand)) ||
|
||||
(elf_insert_brand_entry(&linux_glibc2brand)))
|
||||
uprintf("Could not install ELF interpreter entry\n");
|
||||
/* uprintf("Linux emulator installed\n"); XXX - shut up, you! */
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user