bfd.flags&DYNAMIC vs. bfd_link_info.static
John Reiser
jreiser@BitWagon.com
Fri Jun 1 11:35:00 GMT 2001
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.
--
More information about the Binutils
mailing list