Linking against ET_EXEC objects

Jakub Jelinek jakub@redhat.com
Wed Oct 13 14:28:00 GMT 2004


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



More information about the Binutils mailing list