This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gcc3] uleb128 assembler directive
- To: gcc-patches at gcc dot gnu dot org
- Subject: [gcc3] uleb128 assembler directive
- From: Richard Henderson <rth at redhat dot com>
- Date: Wed, 16 May 2001 12:06:27 -0700
I've merged the following to the branch. The code that looks for
HAVE_AS_LEB128 was already merged, it just wasn't being used.
Using .uleb128 when available reduces the size of exception handling
data by well over half.
r~
2001-03-08 Richard Henderson <rth@redhat.com>
* configure.in (HAVE_AS_LEB128): New assembler check.
* configure, config.in: Rebuilt.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.483.2.14
diff -c -p -d -r1.483.2.14 configure.in
*** configure.in 2001/05/15 01:52:29 1.483.2.14
--- configure.in 2001/05/16 18:58:25
*************** if test x"$gcc_cv_as_hidden" = xyes; the
*** 1299,1304 ****
--- 1299,1348 ----
fi
AC_MSG_RESULT($gcc_cv_as_hidden)
+ AC_MSG_CHECKING(assembler leb128 support)
+ gcc_cv_as_leb128=no
+ 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 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+ gcc_cv_as_leb128="yes"
+ fi
+ elif test x$gcc_cv_as != x; then
+ # Check if we have .[us]leb128, and support symbol arithmetic with it.
+ cat > conftest.s <<EOF
+ .data
+ .uleb128 L2 - L1
+ L1:
+ .uleb128 1280
+ .sleb128 -1010
+ L2:
+ EOF
+ if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+ gcc_cv_as_leb128="yes"
+
+ # GAS versions before 2.11 do not support uleb128,
+ # despite appearing to.
+ # ??? There exists an elf-specific test that will crash
+ # the assembler. Perhaps it's better to figure out whether
+ # arbitrary sections are supported and try the test.
+ as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+ if echo "$as_ver" | grep GNU > /dev/null; then
+ as_ver=`echo $as_ver | sed -e 's/.* //'`
+ as_major=`echo $as_ver | sed 's/\..*//'`
+ changequote(,)dnl
+ as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
+ changequote([,])dnl
+ if test $as_major -eq 2 -a $as_minor -lt 11; then
+ gcc_cv_as_leb128="no"
+ fi
+ fi
+ fi
+ rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
+ fi
+ if test x"$gcc_cv_as_leb128" = xyes; then
+ AC_DEFINE(HAVE_AS_LEB128, 1,
+ [Define if your assembler supports .uleb128.])
+ fi
+ AC_MSG_RESULT($gcc_cv_as_leb128)
+
AC_MSG_CHECKING(assembler eh_frame optimization)
gcc_cv_as_eh_frame=no
if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then