This is the mail archive of the
mailing list for the glibc project.
Re: sh4 fails on check-textrel in glibc-2.3.2 even though there areno relocations?
- From: Dan Kegel <dank at kegel dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Thu, 31 Jul 2003 15:28:50 -0700
- Subject: Re: sh4 fails on check-textrel in glibc-2.3.2 even though there areno relocations?
- References: <200307312105.h6VL5NY23362@magilla.sf.frob.com>
Roland McGrath wrote:
check-textrel still fails. Oddly, when you use readelf -a to look
at the .so's that supposedly have relocations, there aren't any,
but there is a size-zero TEXTREL:
That sounds like an ld bug. DT_TEXTREL set by ld -shared when it thinks
there were some dynamic relocs in read-only segments.
Kai sent me a test patch for binutils,
--- src/bfd/elf32-sh.c.old Fri Jul 25 14:46:58 2003
+++ src/bfd/elf32-sh.c Thu Jul 31 21:09:38 2003
@@ -6497,8 +6497,10 @@ sh_elf_check_relocs (bfd *abfd, struct b
if (sec->flags & SEC_READONLY)
info->flags |= DF_TEXTREL;
elf_section_data (sec)->sreloc = sreloc;
and sure enough, check-textrel no longer complained.
Unfortunately, although the gcc and glibc regression tests link
now, dynamically linked programs all crash with an illegal instruction.
I don't know enough to know whether that's a new problem,
or whether it's an expected outcome of the test binutils patch.
I guess I could link a static copy of gdbserver and run
it via chroot without a shell, and see if it could tell me
what's going on... alternately, I'd be happy to send my build
script to anyone. It's quite easy to reproduce.
> You should
double-check that all the dynamic relocations shown by readelf lie in
addresses in writable segments.
Er, I guess that means looking at the output of readelf -r
but it'd take a while for me to figure that out. (Maybe
check-textrel should output more descriptive errors.)