This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386] Remove EBX usage from asm code
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>, Evgeny Stupachenko <evstupac at gmail dot com>
- Date: Mon, 26 Jan 2015 14:23:46 +0100
- Subject: Re: [PATCH, i386] Remove EBX usage from asm code
- Authentication-results: sourceware.org; auth=none
- References: <CAOvf_xxRWG-rskfXsgwqTV=DhzPiBrR+2J1QFfH-+eA1BiL_4A at mail dot gmail dot com> <yddwq4lpha9 dot fsf at CeBiTec dot Uni-Bielefeld dot DE> <CAFULd4Yo0qaU16AFCaDhLu6gg4AVoh3Z18boDsf8BAJH=pPzzw at mail dot gmail dot com> <yddsif9p84i dot fsf at CeBiTec dot Uni-Bielefeld dot DE> <CAFULd4Y6tT5sBD1H9zoAg7M6tG5Hc9z0=ZPFDLTKLKJgN2mgzQ at mail dot gmail dot com> <yddvbk1okjb dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAFULd4ZH-tSezjhJHhOksLqiRhwPTvihBuAQjibHTq4PThnw9A at mail dot gmail dot com> <20150120095833 dot GB1746 at tucnak dot redhat dot com> <CAFULd4bACGP0MrWjp+AaLOLUKsStpnSCeCYUMmcNTj1Yqt7YCw at mail dot gmail dot com> <20150123120431 dot GQ1746 at tucnak dot redhat dot com> <CAFULd4aBy8JVxDOBsiiA+gHrkdPJb09wdooopZb3BOwKHXzH7A at mail dot gmail dot com> <CAFULd4YcPLiac6D1DfY32dAps8iO_WEosWPz48b=EF-Hp1p7_Q at mail dot gmail dot com>
Uros Bizjak <ubizjak@gmail.com> writes:
>> Yes, the name is better. It would also fit with Solaris.
>
> Bootstrap and regression test was OK.
>
> Committed with following ChangeLogs:
>
> libgcc/ChangeLog:
>
> 2015-01-23 Uros Bizjak <ubizjak@gmail.com>
>
> * config/i386/elf-lib.h: New file.
> (CRT_GET_RFIB_DATA): Move definition from gcc/config/i386/gnu-user.h.
> Wrap definition in #ifdef __i386__.
> * libgcc/config.host (i[34567]86-*-linux*, i[34567]86-*-kfreebsd*-gnu)
> (i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*)
> (i[34567]86-*-kopensolaris*-gnu, x86_64-*-linux*)
> (x86_64-*-kfreebsd*-gnu, x86_64-*-knetbsd*-gnu): Add i386/elf-lib.h
> to tm_file.
>
> gcc/ChangeLog:
>
> 2015-01-23 Uros Bizjak <ubizjak@gmail.com>
>
> * config/i386/gnu-user.h (CRT_GET_RFIB_DATA): Move definition to
> libgcc/config/i386/elf-lib.h.
I'll be comitting the following (which also removes the now unnecessary
Solaris/amd64 workaround from the unwinder) once another round of
bootstraps (Solaris 10 and 11/x86) has completed.
Rainer
2015-01-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc:
* config/i386/sysv4.h (CRT_GET_RFIB_DATA): Remove.
libgcc:
* config.host (i[34567]86-*-solaris2*, x86_64-*-solaris2.1[0-9]*):
Add i386/elf-lib.h to tm_file.
* config/i386/elf-lib.h: Fix comment.
* unwind-dw2-fde-dip.c (_Unwind_IteratePhdrCallback) [__x86_64__
&& __sun__ && __svr4__]: Remove workaround.
# HG changeset patch
# Parent b339ee5283ddcbd36c1afabc73f418e6ce9518ed
Only define CRT_GET_RFIB_DATA for 32-bit in i386/sysv4.h
diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h
--- a/gcc/config/i386/sysv4.h
+++ b/gcc/config/i386/sysv4.h
@@ -49,16 +49,3 @@ along with GCC; see the file COPYING3.
goto DONE; \
} \
} while (0)
-
-/* Used by crtstuff.c to initialize the base of data-relative relocations.
- These are GOT relative on x86, so return the pic register. */
-#define CRT_GET_RFIB_DATA(BASE) \
- __asm__ ("call\t.LPR%=\n" \
- ".LPR%=:\n\t" \
- "pop{l}\t%0\n\t" \
- /* Due to a GAS bug, this cannot use EAX. That encodes \
- smaller than the traditional EBX, which results in the \
- offset being off by one. */ \
- "add{l}\t{$_GLOBAL_OFFSET_TABLE_+[.-.LPR%=],%0" \
- "|%0,_GLOBAL_OFFSET_TABLE_+(.-.LPR%=)}" \
- : "=d"(BASE))
diff --git a/libgcc/config.host b/libgcc/config.host
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -619,6 +619,7 @@ i[34567]86-*-rtems*)
i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
+ tm_file="${tm_file} i386/elf-lib.h"
md_unwind_header=i386/sol2-unwind.h
;;
i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
diff --git a/libgcc/config/i386/elf-lib.h b/libgcc/config/i386/elf-lib.h
--- a/libgcc/config/i386/elf-lib.h
+++ b/libgcc/config/i386/elf-lib.h
@@ -1,4 +1,4 @@
-/* Definitions for Intel 386 systems using GNU userspace.
+/* Definitions for Intel 386 ELF systems.
Copyright (C) 2015 Free Software Foundation, Inc.
GCC is free software; you can redistribute it and/or modify it under
diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
--- a/libgcc/unwind-dw2-fde-dip.c
+++ b/libgcc/unwind-dw2-fde-dip.c
@@ -343,9 +343,6 @@ static int
}
# elif defined __FRV_FDPIC__ && defined __linux__
data->dbase = load_base.got_value;
-# elif defined __x86_64__ && defined __sun__ && defined __svr4__
- /* While CRT_GET_RFIB_DATA is also defined for 64-bit Solaris 10+/x86, it
- doesn't apply since it uses DW_EH_PE_pcrel encoding. */
# else
# error What is DW_EH_PE_datarel base on this platform?
# endif
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
- References:
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code
- Re: [PATCH, i386] Remove EBX usage from asm code