This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Linking against ET_EXEC objects
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Wed, 13 Oct 2004 16:27:42 +0200
- Subject: Linking against ET_EXEC objects
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=135498
is a linker assert failure/segfault on PPC64 when building
klibc.
It turns out this is because klibc's libc.so is ET_EXEC object
which has no relocations, .dynamic sections etc.
Is linking against ET_EXEC objects something that we should
support at all?
If no, we should issue an error message early and bail out.
If yes, I'm afraid we need to audit the abfd->flags & DYNAMIC
checks all around the code and see what are relevant also
to ET_EXEC (in bfd's speak abfd->flags & EXEC_P) input files.
E.g. in elf_link_add_object_symbols in that case would probably
need:
- if ((abfd->flags & DYNAMIC) == 0)
+ if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0)
dynamic = FALSE;
else
{
dynamic = TRUE;
so that abfd->sections is NULL etc., but when I did this,
ld failed assertions elsewhere.
Jakub