From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12767 invoked by alias); 7 May 2010 15:39:00 -0000 Received: (qmail 12757 invoked by uid 22791); 7 May 2010 15:38:59 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 May 2010 15:38:55 +0000 Received: (qmail 18354 invoked from network); 7 May 2010 15:38:53 -0000 Received: from unknown (HELO ?192.168.0.104?) (ams@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 May 2010 15:38:53 -0000 Message-ID: <4BE4340A.5050004@codesourcery.com> Date: Fri, 07 May 2010 15:39:00 -0000 From: Andrew Stubbs User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: prelink@sourceware.org Subject: [PATCH] Fix MIPS debug info prelinking Content-Type: multipart/mixed; boundary="------------040607050509030300070108" Mailing-List: contact prelink-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: prelink-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00001.txt.bz2 This is a multi-part message in MIME format. --------------040607050509030300070108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 580 Hi all, Prelink currently fails to relocate the debug info in MIPS libraries because they use a custom section type. Here is an example section from PPC: [29] .debug_frame PROGBITS 00000000 0021b0 00002c 00 0 0 4 The type is "PROGBITS", which is what prelink likes, so it works correctly. Now, here is an example from an equivalent MIPS binary: [28] .debug_frame MIPS_DWARF 00000000 000ee8 00002c 00 0 0 4 Here the type is "MIPS_DWARF", a type not handled by prelink. Please accept the attached patch to fix this. Thanks Andrew --------------040607050509030300070108 Content-Type: text/x-diff; name="prelink-mips-debug.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="prelink-mips-debug.patch" Content-length: 932 2010-05-06 Andrew Stubbs * src/dso.c (adjust_dso): Support MIPS debug sections. * src/prelink.h (SHT_MIPS_DWARF): New define. Index: src/prelink.h =================================================================== --- src/prelink.h (revision 184) +++ src/prelink.h (working copy) @@ -79,6 +79,10 @@ #define R_MIPS_GLOB_DAT 51 #endif +#ifndef SHT_MIPS_DWARF +#define SHT_MIPS_DWARF 0x7000001e +#endif + #ifndef R_ARM_TLS_DTPMOD32 #define R_ARM_TLS_DTPMOD32 17 #define R_ARM_TLS_DTPOFF32 18 Index: src/dso.c =================================================================== --- src/dso.c (revision 184) +++ src/dso.c (working copy) @@ -1381,6 +1381,7 @@ switch (dso->shdr[i].sh_type) { case SHT_PROGBITS: + case SHT_MIPS_DWARF: name = strptr (dso, dso->ehdr.e_shstrndx, dso->shdr[i].sh_name); if (strcmp (name, ".stab") == 0 && adjust_stabs (dso, i, start, adjust)) --------------040607050509030300070108--