This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ARM EABI uclinux config tweaks
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 20 Mar 2008 19:57:50 +0000
- Subject: ARM EABI uclinux config tweaks
The attached patch tweaks the arm-uclinuxeabi config so that it actually
works. The linker needs various special flags to generate correct binaries,
and we need to select the right unwinding table format.
Tested on arm-uclinuxeabi.
Applied to svn trunk.
Paul
2008-03-20 Paul Brook <paul@codesourcery.com>
gcc/
* config.gcc (arm*-*-uclinux*): Remove duplicate arm/uclinux-elf.h.
* config/arm/uclinux-eabi.h (SUBTARGET_EXTRA_LINK_SPEC): Add extra
linker flags.
* config/arm/bpabi.h (SUBTARGET_EXTRA_LINK_SPEC): Provide default
definition.
(LINK_SPEC): Use SUBTARGET_EXTRA_LINK_SPEC.
* config/arm/unwind-arm.h (_Unwind_decode_target2): Add uClinux.
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc (revision 133353)
+++ gcc/config.gcc (working copy)
@@ -753,7 +753,7 @@ arm*-*-linux*) # ARM GNU/Linux with EL
tmake_file="${tmake_file} arm/t-arm-softfp soft-fp/t-softfp"
;;
arm*-*-uclinux*) # ARM ucLinux
- tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h arm/uclinux-elf.h"
+ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h"
tmake_file="arm/t-arm arm/t-arm-elf"
case ${target} in
arm*-*-uclinux-*eabi)
Index: gcc/config/arm/uclinux-eabi.h
===================================================================
--- gcc/config/arm/uclinux-eabi.h (revision 133353)
+++ gcc/config/arm/uclinux-eabi.h (working copy)
@@ -42,7 +42,8 @@
while (false)
#undef SUBTARGET_EXTRA_LINK_SPEC
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
+#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi -elf2flt" \
+ " --pic-veneer --target2=abs"
/* We default to the "aapcs-linux" ABI so that enums are int-sized by
default. */
Index: gcc/config/arm/bpabi.h
===================================================================
--- gcc/config/arm/bpabi.h (revision 133353)
+++ gcc/config/arm/bpabi.h (working copy)
@@ -55,11 +55,15 @@
#undef SUBTARGET_EXTRA_ASM_SPEC
#define SUBTARGET_EXTRA_ASM_SPEC "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4}"
+#ifndef SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC ""
+#endif
+
/* The generic link spec in elf.h does not support shared libraries. */
#undef LINK_SPEC
#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
- "-X"
+ "-X" SUBTARGET_EXTRA_LINK_SPEC
#if defined (__thumb__)
#define RENAME_LIBRARY_SET ".thumb_set"
Index: gcc/config/arm/unwind-arm.h
===================================================================
--- gcc/config/arm/unwind-arm.h (revision 133353)
+++ gcc/config/arm/unwind-arm.h (working copy)
@@ -232,11 +232,11 @@ extern "C" {
if (!tmp)
return 0;
-#if defined(linux) || defined(__NetBSD__)
+#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__)
/* Pc-relative indirect. */
tmp += ptr;
tmp = *(_Unwind_Word *) tmp;
-#elif defined(__symbian__)
+#elif defined(__symbian__) || defined(__uClinux__)
/* Absolute pointer. Nothing more to do. */
#else
/* Pc-relative pointer. */