> Interesting. Is the DF_TEXTREL flag set in DT_FLAGS instead? Is the > library linked w/ -enable-new-dtags? Are the new dtags enabled by > default in the new binutils? Someting in elf32.em? No. DT_FLAGS entry is not created regardless of whether the --enable-new-dtags parameter has been passed to the linker. Ld simply ignores dynamic relocation entries for local symbols while checking whether either DT_FLAGS or DT_TEXTREL should be created. Attached patch appears to fix the problem for me and has not caused any problems on my test box so far but I am not making any claims about its correctness. Use on your own risk.
> Are the new dtags enabled by default in the new binutils? No, it seems like the new dtags are disabled by default.
Index: bfd/elf32-i386.c =================================================================== RCS file: /usr/ncvs/src/contrib/binutils/bfd/elf32-i386.c,v retrieving revision 1.11 diff -u -r1.11 elf32-i386.c --- bfd/elf32-i386.c 27 Jan 2002 12:07:38 -0000 1.11 +++ bfd/elf32-i386.c 15 Feb 2002 17:21:54 -0000 @@ -1506,6 +1506,10 @@ } else { + asection *s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + info->flags |= DF_TEXTREL; + srel = elf_section_data (p->sec)->sreloc; srel->_raw_size += p->count * sizeof (Elf32_External_Rel); }