From owner-freebsd-current@FreeBSD.ORG Sun Oct 3 16:40:26 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41E6116A4CE for ; Sun, 3 Oct 2004 16:40:26 +0000 (GMT) Received: from mwinf0108.wanadoo.fr (smtp1.wanadoo.fr [193.252.22.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id BECBF43D31 for ; Sun, 3 Oct 2004 16:40:08 +0000 (GMT) (envelope-from dak@wanadoo.fr) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0108.wanadoo.fr (SMTP Server) with SMTP id 9A433180014C for ; Sun, 3 Oct 2004 18:40:07 +0200 (CEST) Received: from smtp.wanadoo.fr (ca-sqy-2-245.w80-8.abo.wanadoo.fr [80.8.55.245]) by mwinf0108.wanadoo.fr (SMTP Server) with ESMTP id 409FA1800145 for ; Sun, 3 Oct 2004 18:40:07 +0200 (CEST) Received: from nebula.wanadoo.fr (localhost [127.0.0.1]) by smtp.wanadoo.fr (8.13.1/8.13.1) with ESMTP id i93Ge6DZ020489 for ; Sun, 3 Oct 2004 18:40:06 +0200 (CEST) (envelope-from dak@nebula.wanadoo.fr) Received: (from dak@localhost) by nebula.wanadoo.fr (8.13.1/8.13.1/Submit) id i93Ge6uA020488 for current@freebsd.org; Sun, 3 Oct 2004 18:40:06 +0200 (CEST) (envelope-from dak) Date: Sun, 3 Oct 2004 18:40:06 +0200 From: Aurelien NEPHTALI To: current@freebsd.org Message-ID: <20041003164006.GA20441@nebula.wanadoo.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: .symtab section is now broken ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 16:40:26 -0000 Hi, I have coded some tools that read ELF binaries. Thet used to work 1 or 2 years ago but now they don't. These tools parse an ELF file to get addresses of malloc(),free(),etc into the PLT to put breakpoint on them. The problem comes from the .symtab section. I'm using this struct to read symbols: typedef struct s_symhdr { unsigned int st_name; unsigned int st_value; unsigned int st_size; unsigned char st_info; unsigned char st_other; unsigned short st_shndx; } t_symhdr; Before, the field 'st_value' contained the symbol's address into the PLT, now it's null, ie (readelf output): 71: 00000000 41 FUNC GLOBAL DEFAULT UND malloc ^^^^^^^^ value I was suspecting the new gcc so I installed gcc 2.95 but it's the same problem. Is there a reason ? What to do to still get the value I want ? I have tested on NetBSD 1.6.1 and it works fine. Thanks. -- NEPHTALI 'dak' Aurelien TEK2 - Promo 2008 06.19.84.90.10