This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: The ia64 linker problems.
On Tue, Feb 06, 2001 at 09:18:00AM -0800, H . J . Lu wrote:
> On Tue, Feb 06, 2001 at 12:49:51AM -0800, Richard Henderson wrote:
> > On Mon, Feb 05, 2001 at 09:45:35PM -0800, H . J . Lu wrote:
> > > * config/tc-ia64.c (ia64_force_relocation): Return 1 for global
> > > symbols.
> >
> > See TC_RELOC_RTSYM_LOC_FIXUP instead. I don't think I truely
> > understand the difference between the two, but that is how
> > other targets prevent the resolution in question.
> >
> >
>
> Here it is. It does the trick.
>
> --
> H.J. Lu (hjl@valinux.com)
> ---
> 2001-02-06 H.J. Lu <hjl@gnu.org>
>
> * config/tc-ia64.h (TC_RELOC_RTSYM_LOC_FIXUP): New. Defined.
>
Well, it is not correct. It failed with things like
.text
.align 16
.global shlib_shlibcall2#
.proc shlib_shlibcall2#
shlib_shlibcall2:
mov.sptk b0 = r2, shlib_overriddencall2#
.align 16
.global shlib_overriddencall2#
.proc shlib_overriddencall2#
shlib_overriddencall2:
br.ret.sptk.many b0
It comes from the Linux kernel. Here is a patch. BTW, I hope gcc won't
generate code like that with -fPIC.
--
2001-02-06 H.J. Lu <hjl@gnu.org>
* * config/tc-ia64.h (TC_RELOC_RTSYM_LOC_FIXUP): Do fixup if
there is no relocation.
Index: config/tc-ia64.h
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/config/tc-ia64.h,v
retrieving revision 1.2
diff -u -p -r1.2 tc-ia64.h
--- config/tc-ia64.h 2001/02/06 17:26:28 1.2
+++ config/tc-ia64.h 2001/02/06 21:40:55
@@ -254,7 +254,8 @@ typedef struct unwind_record
#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \
((FIX)->fx_addsy == NULL \
+ || (FIX)->fx_r_type == 0 \
|| (! S_IS_EXTERNAL ((FIX)->fx_addsy) \
&& ! S_IS_WEAK ((FIX)->fx_addsy) \
- && S_IS_DEFINED ((FIX)->fx_addsy) \
+ && S_IS_DEFINED ((FIX)->fx_addsy) \
&& ! S_IS_COMMON ((FIX)->fx_addsy)))