This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
bfd.flags&DYNAMIC vs. bfd_link_info.static
- Subject: bfd.flags&DYNAMIC vs. bfd_link_info.static
- From: John Reiser <jreiser at BitWagon dot com>
- Date: Fri, 01 Jun 2001 11:27:18 -0700
- CC: binutils at sources dot redhat dot com
- Organization: -
- References: <991410192.21718.ezmlm@sources.redhat.com>
In binutils-2.11/bfd/elf32-i386.c, function elf_i386_relocate_section()
tests elf_hash_table(info)->dynamic_sections_created
when it seems that output_bfd->flags & DYNAMIC, or info->static,
could be more correct. For instance, the dynamic sections are
created for a static link (ET_EXEC) that uses shared libraries,
yet a GOT32 relocation in an input file (a compiled PIC reference
to a defined global) should get the same relocation, independent
of whether the output is linked against shared or not.
[A complete bug report was sent to bug-binutils last night;
link crtbeginS.o without -shared but with -lc, and check the
reference to __dso_handle in __do_global_dtors_aux.]
Also, it seems that bfd_link_info.static is rarely set.
bfd_elf32_bfd_final_link() should set the value near
settting abfd->flags |= DYNAMIC. Or, there could be a
comment about the meaning, coverage, and overlap of
DYNAMIC, dynamic_sections_created, and .static.
--