This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Linking against ET_EXEC objects


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]