From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13793 invoked by alias); 28 Oct 2003 23:50:56 -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 13786 invoked from network); 28 Oct 2003 23:50:56 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 28 Oct 2003 23:50:56 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EF5CC2B89; Mon, 27 Oct 2003 18:49:29 -0500 (EST) Message-ID: <3F9DAF09.6010003@redhat.com> Date: Tue, 28 Oct 2003 23:50:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa:solib] Handle start-address descriptors References: <3F9D67D7.2090003@redhat.com> <1031028215515.ZM3717@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-10/txt/msg00824.txt.bz2 > On Oct 27, 1:45pm, Andrew Cagney wrote: > > >> Index: solib-svr4.c > > ... > >> +#include "bfd-target.h" >> +#include "exec.h" > > > I'm surprised that you needed to include exec.h. solib-svr4.c already > includes target.h and I would've thought this to be sufficient. If > exec.h isn't needed, please take it out. (Don't forget to fix Makefile.in.) They are both needed. >> +/* Given an executable's ABFD and target, compute the entry-point >> + address. */ >> + >> +static CORE_ADDR >> +exec_entry_point (struct bfd *abfd, struct target_ops *targ) >> +{ > > > Could you add a comment here telling why > gdbarch_convert_from_func_ptr_addr() is needed. Maybe something like > this? I'll add your comment. > /* For most targets, the address returned by bfd_get_start_address() > is the entry point for the start function. But, for some targets, > bfd_get_start_address() returns the address of a function descriptor > from which the entry point address may be extracted. This address > is extracted by gdbarch_convert_from_func_ptr_addr(). The method > gdbarch_convert_from_func_ptr_addr() is the merely the identify > function for targets which don't use function descriptors. */ > > Hmm, a possible problem... What happens when the target uses function > descriptors, but not for the exec file's start address? I'm wondering > (ugh) if a separate gdbarch method is required for obtaining the start > address. Fortunatly a previous patch addressed that problem. The convert function is only applied to positively identified descriptors. >> + return gdbarch_convert_from_func_ptr_addr (current_gdbarch, >> + bfd_get_start_address (abfd), >> + targ); >> +} Andrew