linux-mips
[Top] [All Lists]

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

To: ths@networkno.de
Subject: Re: [PATCH] fix modpost segfault for 64bit mipsel kernel
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Tue, 18 Apr 2006 00:47:18 +0900 (JST)
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, sam@ravnborg.org
In-reply-to: <20060417140735.GC28935@networkno.de>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20060417.210039.95063383.nemoto@toshiba-tops.co.jp> <20060417125332.GB28935@networkno.de> <20060417140735.GC28935@networkno.de>
Sender: linux-mips-bounce@linux-mips.org
On Mon, 17 Apr 2006 15:07:35 +0100, Thiemo Seufer <ths@networkno.de> 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
modules?

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>