On Fri, Jan 20, 2012 at 01:05:04PM -0800, Roland McGrath wrote:
Mark is going to look into a new elflint-self regression on Fedora 17. Chances are that is a toolchain bug rather than something for us to fix. But it needs figured out before we consider a release.
The issue is as follows on x86_64 with gcc (GCC) 4.7.0 20120119 (Red Hat 4.7.0-0.8) and binutils-2.22-4.fc17.x86_64 any program will have a __TMC_END__ symbol in .symtab that looks as follows: 66: 0000000000600850 0 OBJECT GLOBAL HIDDEN 24 __TMC_END__ Section 24 is: [24] .data PROGBITS 0000000000600848 00000848 00000004 0 WA 0 0 4 So the address of __TMC_END__ is just beyond the end of the .data section.
__TMC_END__ comes from /usr/lib/gcc/x86_64-redhat-linux/4.7.0/crtend.o 12: 0000000000000000 0 OBJECT GLOBAL HIDDEN 6 __TMC_END__ [ 6] .tm_clone_table PROGBITS 0000000000000000 00000050 00000000 0 WA 0 0 8
I assume this is a linker bug. In elflint we already have special cases for some issues with gnu ld for this particular error:
if (sym->st_value - sh_addr > destshdr->sh_size) { /* GNU ld has severe bugs. When it decides to remove empty sections it leaves symbols referencing them behind. These are symbols in .symtab. */ if (!gnuld || strcmp (section_name (ebl, idx), ".symtab") || (strcmp (name, "__preinit_array_start") != 0 && strcmp (name, "__preinit_array_end") != 0 && strcmp (name, "__init_array_start") != 0 && strcmp (name, "__init_array_end") != 0 && strcmp (name, "__fini_array_start") != 0 && strcmp (name, "__fini_array_end") != 0)) ERROR (gettext ("\ section [%2d] '%s': symbol %zu: st_value out of bounds\n"), idx, section_name (ebl, idx), cnt); }
Do we want an extra special case, or shall I file a bug report against gnu ld?
Cheers,
Mark