From 2c678708e6dc01e097a8cae3688a4adf412d978c Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 4 Nov 2009 09:52:00 +0000 Subject: [PATCH] 2009-11-04 Daniel Jacobowitz Maxim Kuvyrkov * config/tc-m68k.h (CF_DIFF_EXPR_OK): Define to 0 for uClinux. (CFI_DIFF_LSDA_OK): Define. * config/te-uclinux.h: New file. * configure.tgt (m68k-uclinux): Define em. * dw2gencfi.c (CFI_DIFF_LSDA_OK): New macro. (dot_cfi_lsda, output_fde): Use instead of CFI_DIFF_EXPR_OK. --- gas/ChangeLog | 10 ++++++++++ gas/config/tc-m68k.h | 10 ++++++++++ gas/config/te-uclinux.h | 22 ++++++++++++++++++++++ gas/configure.tgt | 2 +- gas/dw2gencfi.c | 12 ++++++++++-- 5 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 gas/config/te-uclinux.h diff --git a/gas/ChangeLog b/gas/ChangeLog index 7b628d4..1dbd3be 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +2009-11-04 Daniel Jacobowitz + Maxim Kuvyrkov + + * config/tc-m68k.h (CF_DIFF_EXPR_OK): Define to 0 for uClinux. + (CFI_DIFF_LSDA_OK): Define. + * config/te-uclinux.h: New file. + * configure.tgt (m68k-uclinux): Define em. + * dw2gencfi.c (CFI_DIFF_LSDA_OK): New macro. + (dot_cfi_lsda, output_fde): Use instead of CFI_DIFF_EXPR_OK. + 2009-11-03 Paul Brook * config/tc-arm.c (do_vfp_nsyn_mla_mls): Fix vmls excoding. diff --git a/gas/config/tc-m68k.h b/gas/config/tc-m68k.h index 30d5c8b..bcf4607 100644 --- a/gas/config/tc-m68k.h +++ b/gas/config/tc-m68k.h @@ -178,3 +178,13 @@ extern int tc_m68k_regname_to_dw2regnum (char *regname); #define tc_cfi_frame_initial_instructions tc_m68k_frame_initial_instructions extern void tc_m68k_frame_initial_instructions (void); + +#ifdef TE_UCLINUX +/* elf2flt does not honor PT_LOAD's from the executable. + .text and .eh_frame sections will not end up in the same segment and so + we cannot use PC-relative encoding for CFI. */ +# define CFI_DIFF_EXPR_OK 0 + +/* However, follow compiler's guidance when it specifies encoding for LSDA. */ +# define CFI_DIFF_LSDA_OK 1 +#endif diff --git a/gas/config/te-uclinux.h b/gas/config/te-uclinux.h new file mode 100644 index 0000000..4a5d879 --- /dev/null +++ b/gas/config/te-uclinux.h @@ -0,0 +1,22 @@ +/* Copyright 2009 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3, + or (at your option) any later version. + + GAS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#define TE_UCLINUX + +#include "te-generic.h" diff --git a/gas/configure.tgt b/gas/configure.tgt index 043f445..86f3eb3 100644 --- a/gas/configure.tgt +++ b/gas/configure.tgt @@ -267,7 +267,7 @@ case ${generic_target} in m68k-*-sysv4*) fmt=elf em=svr4 ;; m68k-*-rtems*) fmt=elf ;; m68k-*-linux-*) fmt=elf em=linux ;; - m68k-*-uclinux*) fmt=elf ;; + m68k-*-uclinux*) fmt=elf em=uclinux ;; m68k-*-gnu*) fmt=elf ;; m68k-*-netbsdelf*) fmt=elf em=nbsd ;; m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c index 5d35712..dfe24af 100644 --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -36,6 +36,14 @@ # endif #endif +#ifndef CFI_DIFF_LSDA_OK +# define CFI_DIFF_LSDA_OK CFI_DIFF_EXPR_OK +#endif + +#if CFI_DIFF_EXPR_OK == 1 && CFI_DIFF_LSDA_OK == 0 +# error "CFI_DIFF_EXPR_OK should imply CFI_DIFF_LSDA_OK" +#endif + /* We re-use DWARF2_LINE_MIN_INSN_LENGTH for the code alignment field of the CIE. Default to 1 if not otherwise specified. */ #ifndef DWARF2_LINE_MIN_INSN_LENGTH @@ -758,7 +766,7 @@ dot_cfi_lsda (int ignored ATTRIBUTE_UNUSED) if ((encoding & 0xff) != encoding || ((encoding & 0x70) != 0 -#if CFI_DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr +#if CFI_DIFF_LSDA_OK || defined tc_cfi_emit_pcrel_expr && (encoding & 0x70) != DW_EH_PE_pcrel #endif ) @@ -1445,7 +1453,7 @@ output_fde (struct fde_entry *fde, struct cie_entry *cie, exp = fde->lsda; if ((fde->lsda_encoding & 0x70) == DW_EH_PE_pcrel) { -#if CFI_DIFF_EXPR_OK +#if CFI_DIFF_LSDA_OK exp.X_op = O_subtract; exp.X_op_symbol = symbol_temp_new_now (); emit_expr (&exp, augmentation_size); -- 2.7.4