From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3823 invoked by alias); 24 Aug 2004 23:39:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3807 invoked from network); 24 Aug 2004 23:39:52 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 24 Aug 2004 23:39:52 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i7ONdqS2017782 for ; Tue, 24 Aug 2004 19:39:52 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i7ONdp323536; Tue, 24 Aug 2004 19:39:51 -0400 Received: from localhost.localdomain (vpn50-92.rdu.redhat.com [172.16.50.92]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i7ONdpJJ003909; Tue, 24 Aug 2004 19:39:51 -0400 Received: from saguaro (saguaro.lan [192.168.64.2]) by localhost.localdomain (8.12.11/8.12.10) with SMTP id i7ONdjG5014913; Tue, 24 Aug 2004 16:39:45 -0700 Date: Tue, 24 Aug 2004 23:39:00 -0000 From: Kevin Buettner To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH/RFA] Don't relocate SunOS-style a.out dynamic executables Message-Id: <20040824163945.35ee121a@saguaro> In-Reply-To: <200408221856.i7MIuYAT034596@elgar.kettenis.dyndns.org> References: <200408221856.i7MIuYAT034596@elgar.kettenis.dyndns.org> Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00679.txt.bz2 On Sun, 22 Aug 2004 20:56:34 +0200 (CEST) Mark Kettenis wrote: > Since I was curious whether our SunOS-style a.out shared library > support still worked, I fired up my virtual VAX[1] and installed > NetBSD 1.5.2 on it. Alas, GDB didn't quite work, and indeed the > solib-sunos.c code is to blame. Some debugging revealed that the code > was relocating the main executable over two bytes. If you know a bit > about the VAX and look at the code it is pretty easy to see why. VAX > functions start at an offset of two bytes from the function's address. Those two bytes are a register save mask? (Not that it matters; just trying to remember something that I knew a very long time ago.) > The code in sunos-solib.c:sunos_relocate_main_executable() compares > the PC with the entry point as recorded in the executable. Since > these differ by two bytes, the code relocates the main executable over > those two bytes. > > The easiest way to solve the problem would be to rip out the code that > tries to relocate the executable. AFAIK SunOS-style a.out executable > aren't relocatable. This code is probably just a leftover from when > the SunOS code was split out of the SVR4 code. Is that right? That sounds like a reasonable guess to me. FWIW, I did test the code after the split, but I tested it on an old SunOS (sparc architecture) system. > If so, I'd like to apply the attached patch. Sure. It's okay with me. Kevin