This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Changes to gas/write.c and others break the ia32 assembler
- To: binutils at sourceware dot cygnus dot com
- Subject: Re: Changes to gas/write.c and others break the ia32 assembler
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Tue, 22 Aug 2000 21:20:37 -0700
- Cc: aoliva at redhat dot com
- References: <20000822181118.A9732@lucon.org> <20000822192240.A9915@lucon.org>
On Tue, Aug 22, 2000 at 07:22:40PM -0700, H . J . Lu wrote:
> On Tue, Aug 22, 2000 at 06:11:18PM -0700, H . J . Lu wrote:
> > Changes to write.c and config/tc-i386.h in since 2000-08-16 breaks
> > the ia32/ELF assembler. I got many failures with "make check" under
> > Linux/ia32. I am looking into them now.
> >
>
> Alexandre, your changes to write.c and other files totally break
> my ia32 assembler under Linux. I am using
>
> # ../configure ... -enable-targets=i386-linuxaout,i386-pe
>
> There are many failures in ld under Linux/glibc 2.2:
>
> FAIL: visibility (hidden_normal) (non PIC)
> FAIL: visibility (hidden_normal) (non PIC, load offset)
> FAIL: visibility (hidden_normal)
> FAIL: visibility (hidden_normal) (PIC main, non PIC so)
> FAIL: visibility (hidden_weak) (non PIC)
> FAIL: visibility (hidden_weak) (non PIC, load offset)
> FAIL: visibility (hidden_weak)
> FAIL: visibility (hidden_weak) (PIC main, non PIC so)
> FAIL: visibility (protected) (non PIC)
> FAIL: visibility (protected) (non PIC, load offset)
> FAIL: visibility (protected)
> FAIL: visibility (protected) (PIC main, non PIC so)
> FAIL: visibility (protected_undef_def) (non PIC)
> FAIL: visibility (protected_undef_def) (non PIC, load offset)
> FAIL: visibility (protected_undef_def)
> FAIL: visibility (protected_undef_def) (PIC main, non PIC so)
> FAIL: visibility (protected_weak) (non PIC)
> FAIL: visibility (protected_weak) (non PIC, load offset)
> FAIL: visibility (protected_weak)
> FAIL: visibility (protected_weak) (PIC main, non PIC so)
> FAIL: visibility (normal) (non PIC)
> FAIL: visibility (normal) (non PIC, load offset)
> FAIL: visibility (normal)
> FAIL: visibility (normal) (PIC main, non PIC so)
> FAIL: weak symbols
>
> Backing out your changes fixes all those failures. Could you please
> fix it?
>
> Thanks.
>
>
> H.J.
This patch seems to work for me on ia32. Alexandre, I am afraid all
those platforms where the original behavior is changed due to your
patch are broken. Could you please double check your patch won't
change the original behavior on any platforms? When you change the
the output of the assembler on the same input, changes are you break
the assembler unless the orginal behavior is wrong. In that case, you
need a testcase to show it.
Thanks.
---
2000-08-22 H.J. Lu <hjl@gnu.org>
* write.c (TC_FIX_ADJUSTABLE): Remove the duplicate.
* config/tc-i386.h (TC_FIX_ADJUSTABLE): Restore it to the
original behavior.
Index: write.c
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/write.c,v
retrieving revision 1.1.1.11
diff -u -p -r1.1.1.11 write.c
--- write.c 2000/08/22 23:49:57 1.1.1.11
+++ write.c 2000/08/23 02:06:19
@@ -56,10 +56,6 @@
#define TC_LINKRELAX_FIXUP(SEG) 1
#endif
-#ifndef TC_FIX_ADJUSTABLE
-#define TC_FIX_ADJUSTABLE(fix) 1
-#endif
-
#ifndef MD_PCREL_FROM_SECTION
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from(FIXP)
#endif
Index: config/tc-i386.h
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/config/tc-i386.h,v
retrieving revision 1.1.1.11
diff -u -p -r1.1.1.11 tc-i386.h
--- config/tc-i386.h 2000/08/22 23:50:00 1.1.1.11
+++ config/tc-i386.h 2000/08/23 04:08:09
@@ -41,10 +41,9 @@ struct fix;
#define tc_fix_adjustable(X) tc_i386_fix_adjustable(X)
extern int tc_i386_fix_adjustable PARAMS ((struct fix *));
-#if defined (OBJ_ELF) || defined (OBJ_COFF) || defined (TE_PE)
-/* This arranges for gas/write.c to not apply a relocation if
- tc_fix_adjustable() says it is not adjustable. */
-#define TC_FIX_ADJUSTABLE(fixP) tc_fix_adjustable (fixP)
+#if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF) || defined (OBJ_COFF)) && !defined (TE_PE)
+/* This tells gas/write.c not to apply a relocation. */
+#define TC_FIX_ADJUSTABLE(fixP) 0
#endif
/* This is the relocation type for direct references to GLOBAL_OFFSET_TABLE.