For m68k, use __mc68000__ (not __m68k__ ), since that is what the

various m68k compilers seem to actually use...
 -Erik
This commit is contained in:
Eric Andersen 2001-06-19 15:00:52 +00:00
parent 74c97cdba6
commit b4a26e6fc0
2 changed files with 34 additions and 34 deletions

View File

@ -130,7 +130,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1; static const int MODUTILS_MODULE_H = 1;
#ident "$Id: insmod.c,v 1.65 2001/05/24 14:16:28 andersen Exp $" #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* 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 We do not use the kernel headers directly because we do not wish
@ -347,7 +347,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1; static const int MODUTILS_OBJ_H = 1;
#ident "$Id: insmod.c,v 1.65 2001/05/24 14:16:28 andersen Exp $" #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -372,7 +372,7 @@ static const int MODUTILS_OBJ_H = 1;
#define ELFCLASSM ELFCLASS32 #define ELFCLASSM ELFCLASS32
#if (defined(__m68k__)) #if (defined(__mc68000__))
#define ELFDATAM ELFDATA2MSB #define ELFDATAM ELFDATA2MSB
#endif #endif
@ -435,7 +435,7 @@ static const int MODUTILS_OBJ_H = 1;
#define Elf32_RelM Elf32_Rel #define Elf32_RelM Elf32_Rel
#define ELFDATAM ELFDATA2LSB #define ELFDATAM ELFDATA2LSB
#elif defined(__m68k__) #elif defined(__mc68000__)
#define MATCH_MACHINE(x) (x == EM_68K) #define MATCH_MACHINE(x) (x == EM_68K)
#define SHT_RELM SHT_RELA #define SHT_RELM SHT_RELA
@ -813,7 +813,7 @@ arch_apply_relocation(struct obj_file *f,
case R_ARM_NONE: case R_ARM_NONE:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_NONE: case R_386_NONE:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_NONE: case R_68K_NONE:
#elif defined(__powerpc__) #elif defined(__powerpc__)
case R_PPC_NONE: case R_PPC_NONE:
@ -828,7 +828,7 @@ arch_apply_relocation(struct obj_file *f,
case R_ARM_ABS32: case R_ARM_ABS32:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_32: case R_386_32:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_32: case R_68K_32:
#elif defined(__powerpc__) #elif defined(__powerpc__)
case R_PPC_ADDR32: case R_PPC_ADDR32:
@ -837,7 +837,7 @@ arch_apply_relocation(struct obj_file *f,
#endif #endif
*loc += v; *loc += v;
break; break;
#if defined(__m68k__) #if defined(__mc68000__)
case R_68K_8: case R_68K_8:
if (v > 0xff) if (v > 0xff)
ret = obj_reloc_overflow; ret = obj_reloc_overflow;
@ -848,7 +848,7 @@ arch_apply_relocation(struct obj_file *f,
ret = obj_reloc_overflow; ret = obj_reloc_overflow;
*(short *)loc = v; *(short *)loc = v;
break; break;
#endif /* __m68k__ */ #endif /* __mc68000__ */
#if defined(__powerpc__) #if defined(__powerpc__)
case R_PPC_ADDR16_HA: case R_PPC_ADDR16_HA:
@ -954,7 +954,7 @@ arch_apply_relocation(struct obj_file *f,
case R_386_PC32: case R_386_PC32:
*loc += v - dot; *loc += v - dot;
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_PC8: case R_68K_PC8:
v -= dot; v -= dot;
if ((Elf32_Sword)v > 0x7f || (Elf32_Sword)v < -(Elf32_Sword)0x80) if ((Elf32_Sword)v > 0x7f || (Elf32_Sword)v < -(Elf32_Sword)0x80)
@ -1049,7 +1049,7 @@ arch_apply_relocation(struct obj_file *f,
case R_386_JMP_SLOT: case R_386_JMP_SLOT:
*loc = v; *loc = v;
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GLOB_DAT: case R_68K_GLOB_DAT:
case R_68K_JMP_SLOT: case R_68K_JMP_SLOT:
*loc = v; *loc = v;
@ -1065,7 +1065,7 @@ arch_apply_relocation(struct obj_file *f,
case R_386_RELATIVE: case R_386_RELATIVE:
*loc += f->baseaddr; *loc += f->baseaddr;
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_RELATIVE: case R_68K_RELATIVE:
*(int *)loc += f->baseaddr; *(int *)loc += f->baseaddr;
break; break;
@ -1096,7 +1096,7 @@ arch_apply_relocation(struct obj_file *f,
case R_ARM_GOT32: case R_ARM_GOT32:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_GOT32: case R_386_GOT32:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GOT32: case R_68K_GOT32:
#endif #endif
assert(isym != NULL); assert(isym != NULL);
@ -1108,26 +1108,26 @@ arch_apply_relocation(struct obj_file *f,
/* make the reloc with_respect_to_.got */ /* make the reloc with_respect_to_.got */
#if defined(__sh__) #if defined(__sh__)
*loc += isym->gotent.offset + rel->r_addend; *loc += isym->gotent.offset + rel->r_addend;
#elif defined(__i386__) || defined(__arm__) || defined(__m68k__) #elif defined(__i386__) || defined(__arm__) || defined(__mc68000__)
*loc += isym->gotent.offset; *loc += isym->gotent.offset;
#endif #endif
break; break;
/* address relative to the got */ /* address relative to the got */
#if !defined(__m68k__) #if !defined(__mc68000__)
#if defined(__sh__) #if defined(__sh__)
case R_SH_GOTOFF: case R_SH_GOTOFF:
#elif defined(__arm__) #elif defined(__arm__)
case R_ARM_GOTOFF: case R_ARM_GOTOFF:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_GOTOFF: case R_386_GOTOFF:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GOTOFF: case R_68K_GOTOFF:
#endif #endif
assert(got != 0); assert(got != 0);
*loc += v - got; *loc += v - got;
break; break;
#endif // __m68k__ #endif // __mc68000__
#endif /* BB_USE_GOT_ENTRIES */ #endif /* BB_USE_GOT_ENTRIES */
@ -1183,7 +1183,7 @@ int arch_create_got(struct obj_file *f)
#elif defined(__i386__) #elif defined(__i386__)
case R_386_GOT32: case R_386_GOT32:
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GOT32: case R_68K_GOT32:
break; break;
#endif #endif

View File

@ -130,7 +130,7 @@
#ifndef MODUTILS_MODULE_H #ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1; static const int MODUTILS_MODULE_H = 1;
#ident "$Id: insmod.c,v 1.65 2001/05/24 14:16:28 andersen Exp $" #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels. /* 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 We do not use the kernel headers directly because we do not wish
@ -347,7 +347,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H #ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1; static const int MODUTILS_OBJ_H = 1;
#ident "$Id: insmod.c,v 1.65 2001/05/24 14:16:28 andersen Exp $" #ident "$Id: insmod.c,v 1.66 2001/06/19 15:00:52 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */ /* The relocatable object is manipulated using elfin types. */
@ -372,7 +372,7 @@ static const int MODUTILS_OBJ_H = 1;
#define ELFCLASSM ELFCLASS32 #define ELFCLASSM ELFCLASS32
#if (defined(__m68k__)) #if (defined(__mc68000__))
#define ELFDATAM ELFDATA2MSB #define ELFDATAM ELFDATA2MSB
#endif #endif
@ -435,7 +435,7 @@ static const int MODUTILS_OBJ_H = 1;
#define Elf32_RelM Elf32_Rel #define Elf32_RelM Elf32_Rel
#define ELFDATAM ELFDATA2LSB #define ELFDATAM ELFDATA2LSB
#elif defined(__m68k__) #elif defined(__mc68000__)
#define MATCH_MACHINE(x) (x == EM_68K) #define MATCH_MACHINE(x) (x == EM_68K)
#define SHT_RELM SHT_RELA #define SHT_RELM SHT_RELA
@ -813,7 +813,7 @@ arch_apply_relocation(struct obj_file *f,
case R_ARM_NONE: case R_ARM_NONE:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_NONE: case R_386_NONE:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_NONE: case R_68K_NONE:
#elif defined(__powerpc__) #elif defined(__powerpc__)
case R_PPC_NONE: case R_PPC_NONE:
@ -828,7 +828,7 @@ arch_apply_relocation(struct obj_file *f,
case R_ARM_ABS32: case R_ARM_ABS32:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_32: case R_386_32:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_32: case R_68K_32:
#elif defined(__powerpc__) #elif defined(__powerpc__)
case R_PPC_ADDR32: case R_PPC_ADDR32:
@ -837,7 +837,7 @@ arch_apply_relocation(struct obj_file *f,
#endif #endif
*loc += v; *loc += v;
break; break;
#if defined(__m68k__) #if defined(__mc68000__)
case R_68K_8: case R_68K_8:
if (v > 0xff) if (v > 0xff)
ret = obj_reloc_overflow; ret = obj_reloc_overflow;
@ -848,7 +848,7 @@ arch_apply_relocation(struct obj_file *f,
ret = obj_reloc_overflow; ret = obj_reloc_overflow;
*(short *)loc = v; *(short *)loc = v;
break; break;
#endif /* __m68k__ */ #endif /* __mc68000__ */
#if defined(__powerpc__) #if defined(__powerpc__)
case R_PPC_ADDR16_HA: case R_PPC_ADDR16_HA:
@ -954,7 +954,7 @@ arch_apply_relocation(struct obj_file *f,
case R_386_PC32: case R_386_PC32:
*loc += v - dot; *loc += v - dot;
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_PC8: case R_68K_PC8:
v -= dot; v -= dot;
if ((Elf32_Sword)v > 0x7f || (Elf32_Sword)v < -(Elf32_Sword)0x80) if ((Elf32_Sword)v > 0x7f || (Elf32_Sword)v < -(Elf32_Sword)0x80)
@ -1049,7 +1049,7 @@ arch_apply_relocation(struct obj_file *f,
case R_386_JMP_SLOT: case R_386_JMP_SLOT:
*loc = v; *loc = v;
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GLOB_DAT: case R_68K_GLOB_DAT:
case R_68K_JMP_SLOT: case R_68K_JMP_SLOT:
*loc = v; *loc = v;
@ -1065,7 +1065,7 @@ arch_apply_relocation(struct obj_file *f,
case R_386_RELATIVE: case R_386_RELATIVE:
*loc += f->baseaddr; *loc += f->baseaddr;
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_RELATIVE: case R_68K_RELATIVE:
*(int *)loc += f->baseaddr; *(int *)loc += f->baseaddr;
break; break;
@ -1096,7 +1096,7 @@ arch_apply_relocation(struct obj_file *f,
case R_ARM_GOT32: case R_ARM_GOT32:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_GOT32: case R_386_GOT32:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GOT32: case R_68K_GOT32:
#endif #endif
assert(isym != NULL); assert(isym != NULL);
@ -1108,26 +1108,26 @@ arch_apply_relocation(struct obj_file *f,
/* make the reloc with_respect_to_.got */ /* make the reloc with_respect_to_.got */
#if defined(__sh__) #if defined(__sh__)
*loc += isym->gotent.offset + rel->r_addend; *loc += isym->gotent.offset + rel->r_addend;
#elif defined(__i386__) || defined(__arm__) || defined(__m68k__) #elif defined(__i386__) || defined(__arm__) || defined(__mc68000__)
*loc += isym->gotent.offset; *loc += isym->gotent.offset;
#endif #endif
break; break;
/* address relative to the got */ /* address relative to the got */
#if !defined(__m68k__) #if !defined(__mc68000__)
#if defined(__sh__) #if defined(__sh__)
case R_SH_GOTOFF: case R_SH_GOTOFF:
#elif defined(__arm__) #elif defined(__arm__)
case R_ARM_GOTOFF: case R_ARM_GOTOFF:
#elif defined(__i386__) #elif defined(__i386__)
case R_386_GOTOFF: case R_386_GOTOFF:
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GOTOFF: case R_68K_GOTOFF:
#endif #endif
assert(got != 0); assert(got != 0);
*loc += v - got; *loc += v - got;
break; break;
#endif // __m68k__ #endif // __mc68000__
#endif /* BB_USE_GOT_ENTRIES */ #endif /* BB_USE_GOT_ENTRIES */
@ -1183,7 +1183,7 @@ int arch_create_got(struct obj_file *f)
#elif defined(__i386__) #elif defined(__i386__)
case R_386_GOT32: case R_386_GOT32:
break; break;
#elif defined(__m68k__) #elif defined(__mc68000__)
case R_68K_GOT32: case R_68K_GOT32:
break; break;
#endif #endif