Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Oct 2004 21:33:04 +0200
From:      Aurelien Nephtali <aurelien.nephtali@wanadoo.fr>
To:        current@freebsd.org
Subject:   Re: .symtab section is now broken ?
Message-ID:  <20041003193304.GA1202@nebula.wanadoo.fr>
In-Reply-To: <20041003164006.GA20441@nebula.wanadoo.fr>
References:  <20041003164006.GA20441@nebula.wanadoo.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
I fixed the problem by linking with -static but I'm sure that before I wasn't
using this.

On Sun, Oct 03, 2004 at 06:40:06PM +0200, Aurelien NEPHTALI wrote:
> 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
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"

-- 
NEPHTALI 'dak' Aurelien
TEK2 - Promo 2008
06.19.84.90.10



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041003193304.GA1202>