This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld -shared --eh-frame-hdr gives empty eh_frame_hdr
- From: Jakub Jelinek <jakub at redhat dot com>
- To: David Simms <david dot simms at bea dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 16 Jul 2004 13:00:45 +0200
- Subject: Re: ld -shared --eh-frame-hdr gives empty eh_frame_hdr
- References: <1089983465.1370.73.camel@genolean.appeal.se>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jul 16, 2004 at 03:11:05PM +0200, David Simms wrote:
> Gidday,
>
> So I was trying compile a small shared library (on x86 with: gcc 3.3.4 +
> binutils 2.15) without -fpic:
>
> $ gcc -c -funwind-tables -o foo.o foo.c
> $ ld --eh-frame-hdr -shared -o foo.so foo.o
You should never use ld directly to link programs, use gcc instead.
It knows all the details how to link a program or a shared library properly.
Particularly, you haven't put in crt files, which means that .eh_frame
is likely not zero terminated as it is required to be.
Jakub