This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

turn on -mexplicit-relocs if possible


Seems to be working fairly well.  Time to give it some wider
testing and see what breaks.


r~


        * config/alpha/alpha.h (TARGET_SWITCHES): Turn on
        MASK_EXPLICIT_RELOCS if the assembler supports it.
        * configure.in (HAVE_AS_EXPLICIT_RELOCS): New.
        * configure, config.in: Rebuild.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.565
diff -c -p -d -r1.565 configure.in
*** configure.in	2001/12/15 11:46:45	1.565
--- configure.in	2001/12/16 01:01:17
*************** fi
*** 1623,1628 ****
--- 1623,1670 ----
  AC_MSG_RESULT($gcc_cv_as_shf_merge)
  
  case "$target" in
+   # All TARGET_ABI_OSF targets.
+   alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
+     AC_CACHE_CHECK([assembler supports explicit relocations],
+ 	gcc_cv_as_explicit_relocs, [
+ 	gcc_cv_as_explicit_relocs=unknown
+ 	if test x$gcc_cv_gas_major_version != x \
+ 		-a x$gcc_cv_gas_minor_version != x
+ 	then
+ 	   if test "$gcc_cv_gas_major_version" -eq 2 \
+ 	           -a "$gcc_cv_gas_minor_version" -ge 12 \
+ 	           -o "$gcc_cv_gas_major_version" -gt 2; then
+ 	      gcc_cv_as_explicit_relocs=yes
+ 	   fi
+ 	elif test x$gcc_cv_as != x; then
+ 	    cat > conftest.s << 'EOF'
+ 	.set nomacro
+ 	.text
+ 	extbl	$3, $2, $3	!lituse_bytoff!1
+ 	ldq	$2, a($29)	!literal!1
+ 	ldq	$4, b($29)	!literal!2
+ 	ldq_u	$3, 0($2)	!lituse_base!1
+ 	ldq	$27, f($29)	!literal!5
+ 	jsr	$26, ($27), f	!lituse_jsr!5
+ 	ldah	$29, 0($26)	!gpdisp!3
+ 	lda	$0, c($29)	!gprel
+ 	ldah	$1, d($29)	!gprelhigh
+ 	lda	$1, d($1)	!gprellow
+ 	lda	$29, 0($29)	!gpdisp!3
+ EOF
+ 	    if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ 		gcc_cv_as_explicit_relocs=yes
+ 	    else
+ 		gcc_cv_as_explicit_relocs=no
+ 	    fi
+ 	    rm -f conftest.s conftest.o
+ 	fi
+     ])
+     if test "x$gcc_cv_as_explicit_relocs" = xyes; then
+ 	AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
+ 		[Define if your assembler supports explicit relocations.])
+     fi
+     ;;
    sparc*-*-*)
      AC_CACHE_CHECK([assembler .register pseudo-op support],
  	gcc_cv_as_register_pseudo_op, [
Index: config/alpha/alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.144
diff -c -p -d -r1.144 alpha.h
*** alpha.h	2001/12/12 06:40:27	1.144
--- alpha.h	2001/12/16 01:01:17
*************** extern enum alpha_fp_trap_mode alpha_fpt
*** 251,262 ****
       N_("Emit 16-bit relocations to the small data areas")},		\
      {"large-data", -MASK_SMALL_DATA,					\
       N_("Emit 32-bit relocations to the small data areas")},		\
!     {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT, ""} }
  
  #define TARGET_DEFAULT MASK_FP|MASK_FPREGS
  
  #ifndef TARGET_CPU_DEFAULT
  #define TARGET_CPU_DEFAULT 0
  #endif
  
  /* This macro is similar to `TARGET_SWITCHES' but defines names of
--- 251,271 ----
       N_("Emit 16-bit relocations to the small data areas")},		\
      {"large-data", -MASK_SMALL_DATA,					\
       N_("Emit 32-bit relocations to the small data areas")},		\
!     {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT				\
! 	 | TARGET_DEFAULT_EXPLICIT_RELOCS, ""} }
  
  #define TARGET_DEFAULT MASK_FP|MASK_FPREGS
  
  #ifndef TARGET_CPU_DEFAULT
  #define TARGET_CPU_DEFAULT 0
+ #endif
+ 
+ #ifndef TARGET_DEFAULT_EXPLICIT_RELOCS
+ #ifdef HAVE_AS_EXPLICIT_RELOCS
+ #define TARGET_DEFAULT_EXPLICIT_RELOCS MASK_EXPLICIT_RELOCS
+ #else
+ #define TARGET_DEFAULT_EXPLICIT_RELOCS 0
+ #endif
  #endif
  
  /* This macro is similar to `TARGET_SWITCHES' but defines names of


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]