public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
@ 2008-10-07 16:10 Rainer Orth
  2008-10-07 16:53 ` Eric Botcazou
  2008-10-09 18:02 ` Eric Botcazou
  0 siblings, 2 replies; 10+ messages in thread
From: Rainer Orth @ 2008-10-07 16:10 UTC (permalink / raw)
  To: gcc-patches

As detected by Eric Botcazou in

	http://sourceware.org/ml/binutils/2008-09/msg00195.html

all EH tests fail on Solaris with the Sun linker if gas emits a mixture of
read-only and read-write .eh_frame sections.  The following patch works
around this problem by detecting if either the linker used supports
read-only and read-write section merging or the assembler used emits
read-write .eh_frame sections before enabling dwarf2-cfi-asm for real.

Tested on i386-pc-solaris2.10 in three combinations:

* with /usr/sfw/bin/gas (gas 2.15) and Sun ld: dwarf2-cfi-asm disabled due
  to read-only .eh_frame sections and no ld section merging

* with /usr/sfw/bin/gas (gas 2.15) and GNU ld 2.17.50: dwarf2-cfi-asm
  enabled due to ld section merging

* with GNU as 2.19.50 including Eric's patch above and Sun ld:
  dwarf2-cfi-asm enabled due to read-write .eh_frame sections

While the first two combinations work ok and restore the EH tests to
working order (with only a few other testsuite differences due to different
capabilities of the linkers used), the third combination doesn't look so
good: while the 32-bit EH tests all work, the large majority of the 64-bit
EH tests fail as before.

I have no good idea how to proceed from here, so I'm offering the current
patch as is because it is a strict improvement over the current situation.

Ok for mainline?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Thu Oct  2 17:48:04 2008  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	PR other/37463
	* configure.ac (gcc_cv_ld_ro_rw_mix): Move before
	gcc_cv_as_cfi_directive.
	(gcc_cv_as_cfi_directive) [*-*-solaris*]: Check if linker supports
	merging read-only and read-write sections or assembler emits
	read-write .eh_frame sections.
	* configure: Regenerate.
	
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 140759)
+++ gcc/configure.ac	(working copy)
@@ -2150,6 +2150,45 @@ if test $gcc_cv_as_hidden = yes && test 
   [Define if your assembler and linker support .hidden.])
 fi
 
+AC_MSG_CHECKING(linker read-only and read-write section mixing)
+gcc_cv_ld_ro_rw_mix=unknown
+if test $in_tree_ld = yes ; then
+  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
+     && test $in_tree_ld_is_elf = yes; then
+    gcc_cv_ld_ro_rw_mix=read-write
+  fi
+elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
+  echo '.section myfoosect, "a"' > conftest1.s
+  echo '.section myfoosect, "aw"' > conftest2.s
+  echo '.byte 1' >> conftest2.s
+  echo '.section myfoosect, "a"' > conftest3.s
+  echo '.byte 0' >> conftest3.s
+  if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \
+     && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
+     && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \
+     && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
+	conftest2.o conftest3.o > /dev/null 2>&1; then
+    gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
+			 | sed -e '/myfoosect/!d' -e N`
+    if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
+      if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
+	gcc_cv_ld_ro_rw_mix=read-only
+      else
+	gcc_cv_ld_ro_rw_mix=read-write
+      fi
+    fi
+  fi
+changequote(,)dnl
+  rm -f conftest.* conftest[123].*
+changequote([,])dnl
+fi
+if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
+	AC_DEFINE(HAVE_LD_RO_RW_SECTION_MIXING, 1,
+  [Define if your linker links a mix of read-only
+   and read-write sections into a read-write section.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
+
 # Check if we have .[us]leb128, and support symbol arithmetic with it.
 gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128,
   [elf,2,11,0],,
@@ -2189,7 +2228,29 @@ gcc_GAS_CHECK_FEATURE([cfi directives], 
 	.cfi_same_value 1
 	.cfi_def_cfa 1, 2
 	.cfi_escape 1, 2, 3, 4, 5
-	.cfi_endproc])
+	.cfi_endproc],
+[case "$target" in
+  *-*-solaris*)
+    # If the linker used on Solaris (like Sun ld) isn't capable of merging
+    # read-only and read-write sections, we need to make sure that the
+    # assembler used emits read-write .eh_frame sections.
+    if test x$gcc_cv_ld_ro_rw_mix != xread-write; then
+      if test x$gcc_cv_objdump != x; then
+	if $gcc_cv_objdump -h conftest.o 2>/dev/null | \
+		sed -e /.eh_frame/!d -e N | grep READONLY > /dev/null; then
+	  gcc_cv_as_cfi_directive=no
+	else
+	  gcc_cv_as_cfi_directive=yes
+	fi
+      fi
+    else
+      gcc_cv_as_cfi_directive=yes
+    fi
+    ;;
+  *-*-*)
+    gcc_cv_as_cfi_directive=yes
+    ;;
+esac])
 AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_DIRECTIVE,
   [`if test $gcc_cv_as_cfi_directive = yes; then echo 1; else echo 0; fi`],
   [Define 0/1 if your assembler supports CFI directives.])
@@ -3218,45 +3279,6 @@ if test "x$gcc_cv_as_line_zero" = xyes; 
 [Define if the assembler won't complain about a line such as # 0 "" 2.])
 fi
 
-AC_MSG_CHECKING(linker read-only and read-write section mixing)
-gcc_cv_ld_ro_rw_mix=unknown
-if test $in_tree_ld = yes ; then
-  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
-     && test $in_tree_ld_is_elf = yes; then
-    gcc_cv_ld_ro_rw_mix=read-write
-  fi
-elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
-  echo '.section myfoosect, "a"' > conftest1.s
-  echo '.section myfoosect, "aw"' > conftest2.s
-  echo '.byte 1' >> conftest2.s
-  echo '.section myfoosect, "a"' > conftest3.s
-  echo '.byte 0' >> conftest3.s
-  if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \
-     && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
-     && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \
-     && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
-	conftest2.o conftest3.o > /dev/null 2>&1; then
-    gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
-			 | sed -e '/myfoosect/!d' -e N`
-    if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
-      if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
-	gcc_cv_ld_ro_rw_mix=read-only
-      else
-	gcc_cv_ld_ro_rw_mix=read-write
-      fi
-    fi
-  fi
-changequote(,)dnl
-  rm -f conftest.* conftest[123].*
-changequote([,])dnl
-fi
-if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
-	AC_DEFINE(HAVE_LD_RO_RW_SECTION_MIXING, 1,
-  [Define if your linker links a mix of read-only
-   and read-write sections into a read-write section.])
-fi
-AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
-
 AC_MSG_CHECKING(linker PT_GNU_EH_FRAME support)
 gcc_cv_ld_eh_frame_hdr=no
 if test $in_tree_ld = yes ; then

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-07 16:10 PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail) Rainer Orth
@ 2008-10-07 16:53 ` Eric Botcazou
  2008-10-08 17:26   ` Eric Botcazou
  2008-10-09 18:02 ` Eric Botcazou
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Botcazou @ 2008-10-07 16:53 UTC (permalink / raw)
  To: gcc-patches; +Cc: Rainer Orth

> While the first two combinations work ok and restore the EH tests to
> working order (with only a few other testsuite differences due to different
> capabilities of the linkers used), the third combination doesn't look so
> good: while the 32-bit EH tests all work, the large majority of the 64-bit
> EH tests fail as before.

Strange, results are nominal on the SPARC with GNU as 2.19.50, both in 32-bit 
and 64-bit mode.  I'll look into what happens with the 64-bit mode on x86.

> I have no good idea how to proceed from here, so I'm offering the current
> patch as is because it is a strict improvement over the current situation.

FWIW I agree, thanks for writing it.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-07 16:53 ` Eric Botcazou
@ 2008-10-08 17:26   ` Eric Botcazou
  2008-10-08 18:50     ` Rainer Orth
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Botcazou @ 2008-10-08 17:26 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

> I'll look into what happens with the 64-bit mode on x86.

Hum... I'm running into PR bootstrap/33100 on the machine.  Do you happen to 
know if Sun has done something for it?

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-08 17:26   ` Eric Botcazou
@ 2008-10-08 18:50     ` Rainer Orth
  0 siblings, 0 replies; 10+ messages in thread
From: Rainer Orth @ 2008-10-08 18:50 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

Eric Botcazou writes:

> > I'll look into what happens with the 64-bit mode on x86.
> 
> Hum... I'm running into PR bootstrap/33100 on the machine.  Do you happen to 
> know if Sun has done something for it?

As mentioned in Comment #17 of that PR, the bug is fixed in snv_88
(i.e. all recent OpenSolaris releases have it).  I have no idea what the
status of a Solaris 10 backport is.

I've just included my workaround in the PR: one could either install it
unconditionally or try do detect the condition and only apply it if the
linker bug is present.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-07 16:10 PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail) Rainer Orth
  2008-10-07 16:53 ` Eric Botcazou
@ 2008-10-09 18:02 ` Eric Botcazou
  2008-10-10 15:01   ` Rainer Orth
  1 sibling, 1 reply; 10+ messages in thread
From: Eric Botcazou @ 2008-10-09 18:02 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

> While the first two combinations work ok and restore the EH tests to
> working order (with only a few other testsuite differences due to different
> capabilities of the linkers used), the third combination doesn't look so
> good: while the 32-bit EH tests all work, the large majority of the 64-bit
> EH tests fail as before.

This should be fixed with up-to-date binutils mainline and 2.19 branch.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-09 18:02 ` Eric Botcazou
@ 2008-10-10 15:01   ` Rainer Orth
  2008-10-31 20:01     ` Alexandre Oliva
  0 siblings, 1 reply; 10+ messages in thread
From: Rainer Orth @ 2008-10-10 15:01 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

Eric Botcazou writes:

> > While the first two combinations work ok and restore the EH tests to
> > working order (with only a few other testsuite differences due to different
> > capabilities of the linkers used), the third combination doesn't look so
> > good: while the 32-bit EH tests all work, the large majority of the 64-bit
> > EH tests fail as before.
> 
> This should be fixed with up-to-date binutils mainline and 2.19 branch.

Indeed: results for all three combinations tested (gas 2.15/sun ld, gas
2.15/gld 2.17.50 and gas 2.19.50/sun ld) are now practically identical.

Thanks a lot for your help.

Any takers for the patch at hand

	http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00249.html

which fixes EH tests on Solaris/x86?

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-10 15:01   ` Rainer Orth
@ 2008-10-31 20:01     ` Alexandre Oliva
  2008-10-31 20:04       ` Rainer Orth
  0 siblings, 1 reply; 10+ messages in thread
From: Alexandre Oliva @ 2008-10-31 20:01 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Eric Botcazou, gcc-patches

On Oct 10, 2008, Rainer Orth <ro@techfak.uni-bielefeld.de> wrote:

> Indeed: results for all three combinations tested (gas 2.15/sun ld, gas
> 2.15/gld 2.17.50 and gas 2.19.50/sun ld) are now practically identical.

> Any takers for the patch at hand

> 	http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00249.html

> which fixes EH tests on Solaris/x86?

Patch looks good, thanks.  I'd have quoted "x$gcc_cv_objdump" in the
test for != x, but that's just me ;-)

I wonder if it would make sense to take the more conservative path in
case we don't have a working objdump to test, or perhaps try to
exercise the bug in this case.  Thoughts?

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ¡Sé Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-31 20:01     ` Alexandre Oliva
@ 2008-10-31 20:04       ` Rainer Orth
  2008-10-31 20:20         ` Alexandre Oliva
  0 siblings, 1 reply; 10+ messages in thread
From: Rainer Orth @ 2008-10-31 20:04 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Eric Botcazou, gcc-patches

Alexandre Oliva writes:

> On Oct 10, 2008, Rainer Orth <ro@techfak.uni-bielefeld.de> wrote:
> 
> > Indeed: results for all three combinations tested (gas 2.15/sun ld, gas
> > 2.15/gld 2.17.50 and gas 2.19.50/sun ld) are now practically identical.
> 
> > Any takers for the patch at hand
> 
> > 	http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00249.html
> 
> > which fixes EH tests on Solaris/x86?
> 
> Patch looks good, thanks.  I'd have quoted "x$gcc_cv_objdump" in the

Thanks.

> test for != x, but that's just me ;-)

I've mimiced the other similar constructs in configure.ac here, and none of
them were quoted.  But I think you're right and will fix this.

> I wonder if it would make sense to take the more conservative path in
> case we don't have a working objdump to test, or perhaps try to
> exercise the bug in this case.  Thoughts?

The conservative path should already be taken, since without objdump
present gcc_cv_as_cfi_directive will not be set at all, which later breaks

AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_DIRECTIVE,
  [`if test $gcc_cv_as_cfi_directive = yes; then echo 1; else echo 0; fi`],

since that assumes that the variable is set somehow.  So I'll make sure it
will be set on all paths.

From problems like those, it seems configure.ac could considerably benefit
from a lookover by a shell/portability expert :-)

I'll revise the patch accordingly and resubmit once testing completes.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-31 20:04       ` Rainer Orth
@ 2008-10-31 20:20         ` Alexandre Oliva
  2008-11-03 19:09           ` Rainer Orth
  0 siblings, 1 reply; 10+ messages in thread
From: Alexandre Oliva @ 2008-10-31 20:20 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Eric Botcazou, gcc-patches

On Oct 31, 2008, Rainer Orth <ro@techfak.uni-bielefeld.de> wrote:

> Alexandre Oliva writes:
>> I'd have quoted "x$gcc_cv_objdump" in the test for != x, but that's
>> just me ;-)

> will fix this.

Thanks,

> The conservative path should already be taken, since without objdump
> present gcc_cv_as_cfi_directive will not be set at all,

Aah, right.  I'd missed that.

> I'll make sure it will be set on all paths.

Thanks.

> I'll revise the patch accordingly and resubmit once testing completes.

These changes are pre-approved.

Best,

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ¡Sé Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail)
  2008-10-31 20:20         ` Alexandre Oliva
@ 2008-11-03 19:09           ` Rainer Orth
  0 siblings, 0 replies; 10+ messages in thread
From: Rainer Orth @ 2008-11-03 19:09 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Eric Botcazou, gcc-patches

Alexandre Oliva writes:

> > I'll revise the patch accordingly and resubmit once testing completes.
> 
> These changes are pre-approved.

Thanks.  I've committed the following after two tests: a full bootstrap on
i386-pc-solaris2.10 with gas 2.15 and objdump present (no cfi support since
the old gas doesn't create rw .eh_frame sections) and the configure step on
the same platform with gas 2.19.50, but without any objdump in path (this
gas does create rw .eh_frame sections, but without objdump it cannot be
detected, so no cfi support either).

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Thu Oct  2 17:48:04 2008  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	PR other/37463
	* configure.ac (gcc_cv_ld_ro_rw_mix): Move before
	gcc_cv_as_cfi_directive.
	(gcc_cv_as_cfi_directive) [*-*-solaris*]: Check if linker supports
	merging read-only and read-write sections or assembler emits
	read-write .eh_frame sections.
	* configure: Regenerate.
	
Index: configure.ac
===================================================================
--- configure.ac	(revision 141554)
+++ configure.ac	(working copy)
@@ -2150,6 +2150,45 @@ if test $gcc_cv_as_hidden = yes && test 
   [Define if your assembler and linker support .hidden.])
 fi
 
+AC_MSG_CHECKING(linker read-only and read-write section mixing)
+gcc_cv_ld_ro_rw_mix=unknown
+if test $in_tree_ld = yes ; then
+  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
+     && test $in_tree_ld_is_elf = yes; then
+    gcc_cv_ld_ro_rw_mix=read-write
+  fi
+elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
+  echo '.section myfoosect, "a"' > conftest1.s
+  echo '.section myfoosect, "aw"' > conftest2.s
+  echo '.byte 1' >> conftest2.s
+  echo '.section myfoosect, "a"' > conftest3.s
+  echo '.byte 0' >> conftest3.s
+  if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \
+     && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
+     && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \
+     && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
+	conftest2.o conftest3.o > /dev/null 2>&1; then
+    gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
+			 | sed -e '/myfoosect/!d' -e N`
+    if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
+      if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
+	gcc_cv_ld_ro_rw_mix=read-only
+      else
+	gcc_cv_ld_ro_rw_mix=read-write
+      fi
+    fi
+  fi
+changequote(,)dnl
+  rm -f conftest.* conftest[123].*
+changequote([,])dnl
+fi
+if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
+	AC_DEFINE(HAVE_LD_RO_RW_SECTION_MIXING, 1,
+  [Define if your linker links a mix of read-only
+   and read-write sections into a read-write section.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
+
 # Check if we have .[us]leb128, and support symbol arithmetic with it.
 gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128,
   [elf,2,11,0],,
@@ -2189,7 +2228,32 @@ gcc_GAS_CHECK_FEATURE([cfi directives], 
 	.cfi_same_value 1
 	.cfi_def_cfa 1, 2
 	.cfi_escape 1, 2, 3, 4, 5
-	.cfi_endproc])
+	.cfi_endproc],
+[case "$target" in
+  *-*-solaris*)
+    # If the linker used on Solaris (like Sun ld) isn't capable of merging
+    # read-only and read-write sections, we need to make sure that the
+    # assembler used emits read-write .eh_frame sections.
+    if test "x$gcc_cv_ld_ro_rw_mix" != xread-write; then
+      if test "x$gcc_cv_objdump" != x; then
+	if $gcc_cv_objdump -h conftest.o 2>/dev/null | \
+		sed -e /.eh_frame/!d -e N | grep READONLY > /dev/null; then
+	  gcc_cv_as_cfi_directive=no
+	else
+	  gcc_cv_as_cfi_directive=yes
+	fi
+      else
+        # no objdump, err on the side of caution
+	gcc_cv_as_cfi_directive=no
+      fi
+    else
+      gcc_cv_as_cfi_directive=yes
+    fi
+    ;;
+  *-*-*)
+    gcc_cv_as_cfi_directive=yes
+    ;;
+esac])
 AC_DEFINE_UNQUOTED(HAVE_GAS_CFI_DIRECTIVE,
   [`if test $gcc_cv_as_cfi_directive = yes; then echo 1; else echo 0; fi`],
   [Define 0/1 if your assembler supports CFI directives.])
@@ -3218,45 +3282,6 @@ if test "x$gcc_cv_as_line_zero" = xyes; 
 [Define if the assembler won't complain about a line such as # 0 "" 2.])
 fi
 
-AC_MSG_CHECKING(linker read-only and read-write section mixing)
-gcc_cv_ld_ro_rw_mix=unknown
-if test $in_tree_ld = yes ; then
-  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
-     && test $in_tree_ld_is_elf = yes; then
-    gcc_cv_ld_ro_rw_mix=read-write
-  fi
-elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
-  echo '.section myfoosect, "a"' > conftest1.s
-  echo '.section myfoosect, "aw"' > conftest2.s
-  echo '.byte 1' >> conftest2.s
-  echo '.section myfoosect, "a"' > conftest3.s
-  echo '.byte 0' >> conftest3.s
-  if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \
-     && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
-     && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \
-     && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
-	conftest2.o conftest3.o > /dev/null 2>&1; then
-    gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
-			 | sed -e '/myfoosect/!d' -e N`
-    if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
-      if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
-	gcc_cv_ld_ro_rw_mix=read-only
-      else
-	gcc_cv_ld_ro_rw_mix=read-write
-      fi
-    fi
-  fi
-changequote(,)dnl
-  rm -f conftest.* conftest[123].*
-changequote([,])dnl
-fi
-if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
-	AC_DEFINE(HAVE_LD_RO_RW_SECTION_MIXING, 1,
-  [Define if your linker links a mix of read-only
-   and read-write sections into a read-write section.])
-fi
-AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
-
 AC_MSG_CHECKING(linker PT_GNU_EH_FRAME support)
 gcc_cv_ld_eh_frame_hdr=no
 if test $in_tree_ld = yes ; then

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-11-03 19:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-07 16:10 PATCH: Fix PR other/37463 (All Solaris/x86 eh tests fail) Rainer Orth
2008-10-07 16:53 ` Eric Botcazou
2008-10-08 17:26   ` Eric Botcazou
2008-10-08 18:50     ` Rainer Orth
2008-10-09 18:02 ` Eric Botcazou
2008-10-10 15:01   ` Rainer Orth
2008-10-31 20:01     ` Alexandre Oliva
2008-10-31 20:04       ` Rainer Orth
2008-10-31 20:20         ` Alexandre Oliva
2008-11-03 19:09           ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).