[Top] [All Lists]

Re: [PATCH] fix modpost segfault for 64bit mipsel kernel

Subject: Re: [PATCH] fix modpost segfault for 64bit mipsel kernel
From: Atsushi Nemoto <>
Date: Tue, 18 Apr 2006 00:47:18 +0900 (JST)
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <>
On Mon, 17 Apr 2006 15:07:35 +0100, Thiemo Seufer <> wrote:
> I should have read more carefully. The ELF_R_SYM seems to be correct, if
> this patch makes it work fo you then the toolchain you use creates broken
> (word-swapped ?) relocation entries for mips64el.

Looking at following codes in glibc source
(sysdeps/mips/elf/ldsodefs.h), I thought r_info on 64bit mips needs
special handling.  Is not this structure used for 64bit kernel

typedef struct
  Elf32_Word    r_sym;          /* Symbol index */
  unsigned char r_ssym;         /* Special symbol for 2nd relocation */
  unsigned char r_type3;        /* 3rd relocation type */
  unsigned char r_type2;        /* 2nd relocation type */
  unsigned char r_type1;        /* 1st relocation type */
} _Elf64_Mips_R_Info;

typedef union
  Elf64_Xword   r_info_number;
  _Elf64_Mips_R_Info r_info_fields;
} _Elf64_Mips_R_Info_union;
typedef struct
  Elf64_Addr    r_offset;               /* Address */
  _Elf64_Mips_R_Info_union r_info;      /* Relocation type and symbol index */
  Elf64_Sxword  r_addend;               /* Addend */
} Elf64_Mips_Rela;

#define ELF64_MIPS_R_SYM(i) \
  ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym)
#undef ELF64_R_SYM
#define ELF64_R_SYM(i) ELF64_MIPS_R_SYM (i)

Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>