From 82bb8a2bf821909496cfe23fd0530500533df6b1 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 22 Mar 2001 19:01:16 +0000 Subject: [PATCH] Patch from Dirk Behme to add EM_MIPS_RS3_LE for mips -Erik --- insmod.c | 15 +++++++++++++-- modutils/insmod.c | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/insmod.c b/insmod.c index fe4e06a6c..0a7cb1e4a 100644 --- a/insmod.c +++ b/insmod.c @@ -119,7 +119,7 @@ #ifndef MODUTILS_MODULE_H static const int MODUTILS_MODULE_H = 1; -#ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" +#ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" /* This file contains the structures used by the 2.0 and 2.1 kernels. We do not use the kernel headers directly because we do not wish @@ -325,7 +325,7 @@ int delete_module(const char *); #ifndef MODUTILS_OBJ_H static const int MODUTILS_OBJ_H = 1; -#ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" +#ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" /* The relocatable object is manipulated using elfin types. */ @@ -373,6 +373,15 @@ static const int MODUTILS_OBJ_H = 1; #elif defined(__mips__) +/* Account for ELF spec changes. */ +#ifndef EM_MIPS_RS3_LE +#ifdef EM_MIPS_RS4_BE +#define EM_MIPS_RS3_LE EM_MIPS_RS4_BE +#else +#define EM_MIPS_RS3_LE 10 +#endif +#endif /* !EM_MIPS_RS3_LE */ + #define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE) #define SHT_RELM SHT_REL #define Elf32_RelM Elf32_Rel @@ -793,7 +802,9 @@ arch_apply_relocation(struct obj_file *f, ElfW(RelM) *rel, ElfW(Addr) v) { struct arch_file *ifile = (struct arch_file *) f; +#if !(defined(__mips__)) struct arch_symbol *isym = (struct arch_symbol *) sym; +#endif ElfW(Addr) *loc = (ElfW(Addr) *) (targsec->contents + rel->r_offset); ElfW(Addr) dot = targsec->header.sh_addr + rel->r_offset; diff --git a/modutils/insmod.c b/modutils/insmod.c index fe4e06a6c..0a7cb1e4a 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c @@ -119,7 +119,7 @@ #ifndef MODUTILS_MODULE_H static const int MODUTILS_MODULE_H = 1; -#ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" +#ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" /* This file contains the structures used by the 2.0 and 2.1 kernels. We do not use the kernel headers directly because we do not wish @@ -325,7 +325,7 @@ int delete_module(const char *); #ifndef MODUTILS_OBJ_H static const int MODUTILS_OBJ_H = 1; -#ident "$Id: insmod.c,v 1.52 2001/03/19 19:28:24 andersen Exp $" +#ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" /* The relocatable object is manipulated using elfin types. */ @@ -373,6 +373,15 @@ static const int MODUTILS_OBJ_H = 1; #elif defined(__mips__) +/* Account for ELF spec changes. */ +#ifndef EM_MIPS_RS3_LE +#ifdef EM_MIPS_RS4_BE +#define EM_MIPS_RS3_LE EM_MIPS_RS4_BE +#else +#define EM_MIPS_RS3_LE 10 +#endif +#endif /* !EM_MIPS_RS3_LE */ + #define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE) #define SHT_RELM SHT_REL #define Elf32_RelM Elf32_Rel @@ -793,7 +802,9 @@ arch_apply_relocation(struct obj_file *f, ElfW(RelM) *rel, ElfW(Addr) v) { struct arch_file *ifile = (struct arch_file *) f; +#if !(defined(__mips__)) struct arch_symbol *isym = (struct arch_symbol *) sym; +#endif ElfW(Addr) *loc = (ElfW(Addr) *) (targsec->contents + rel->r_offset); ElfW(Addr) dot = targsec->header.sh_addr + rel->r_offset; -- 2.25.1