From 794ba86ab2c3af917bb30776338526a18ea74880 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Thu, 15 Mar 2007 12:11:50 +0000 Subject: [PATCH] gas/ * config/tc-arm.c (arm_copy_symbol_attributes): New. * config/tc-arm.h (arm_copy_symbol_attributes): Declare. (TC_COPY_SYMBOL_ATTRIBUTES): Define. * gas/symbols.c (copy_symbol_attributes): Use TC_COPY_SYMBOL_ATTRIBUTES. gas/testsuite/ * gas/arm/thumbver.d, gas/arm/thumbver.s: New test. --- gas/ChangeLog | 8 ++++++++ gas/config/tc-arm.c | 6 ++++++ gas/config/tc-arm.h | 6 ++++++ gas/symbols.c | 4 ++++ gas/testsuite/ChangeLog | 4 ++++ gas/testsuite/gas/arm/thumbver.d | 15 +++++++++++++++ gas/testsuite/gas/arm/thumbver.s | 9 +++++++++ 7 files changed, 52 insertions(+) create mode 100644 gas/testsuite/gas/arm/thumbver.d create mode 100644 gas/testsuite/gas/arm/thumbver.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 4c212dbaaf2..4ee657048a1 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2007-03-14 Daniel Jacobowitz + + * config/tc-arm.c (arm_copy_symbol_attributes): New. + * config/tc-arm.h (arm_copy_symbol_attributes): Declare. + (TC_COPY_SYMBOL_ATTRIBUTES): Define. + * gas/symbols.c (copy_symbol_attributes): Use + TC_COPY_SYMBOL_ATTRIBUTES. + 2007-03-14 Paul Brook * config/tc-arm.c (T16_32_TAB): Fix dec_sp encoding. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 9822ab53e79..b463d9615bd 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -20527,3 +20527,9 @@ s_arm_fpu (int ignored ATTRIBUTE_UNUSED) ignore_rest_of_line (); } +/* Copy symbol information. */ +void +arm_copy_symbol_attributes (symbolS *dest, symbolS *src) +{ + ARM_GET_FLAG (dest) = ARM_GET_FLAG (src); +} diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index d7df2136ecc..d6dee9b1a9a 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -141,6 +141,12 @@ bfd_boolean arm_is_eabi (void); #define ARM_SET_INTERWORK(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_INTERWORK) : ARM_RESET_FLAG (s, ARM_FLAG_INTERWORK)) #define THUMB_SET_FUNC(s,t) ((t) ? ARM_SET_FLAG (s, THUMB_FLAG_FUNC) : ARM_RESET_FLAG (s, THUMB_FLAG_FUNC)) +void arm_copy_symbol_attributes (symbolS *, symbolS *); +#ifndef TC_COPY_SYMBOL_ATTRIBUTES +#define TC_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \ + (arm_copy_symbol_attributes (DEST, SRC)) +#endif + #define TC_START_LABEL(C,STR) (c == ':' || (c == '/' && arm_data_in_code ())) #define tc_canonicalize_symbol_name(str) arm_canonicalize_symbol_name (str); #define obj_adjust_symtab() arm_adjust_symtab () diff --git a/gas/symbols.c b/gas/symbols.c index 5cad5c8ef62..2e098f1f6d1 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -1947,6 +1947,10 @@ copy_symbol_attributes (symbolS *dest, symbolS *src) #ifdef OBJ_COPY_SYMBOL_ATTRIBUTES OBJ_COPY_SYMBOL_ATTRIBUTES (dest, src); #endif + +#ifdef TC_COPY_SYMBOL_ATTRIBUTES + TC_COPY_SYMBOL_ATTRIBUTES (dest, src); +#endif } int diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index a498537e666..e6a5da4caac 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-03-14 Daniel Jacobowitz + + * gas/arm/thumbver.d, gas/arm/thumbver.s: New test. + 2007-03-14 Paul Brook * gas/arm/thumb2_add.d: Add tests using sp. diff --git a/gas/testsuite/gas/arm/thumbver.d b/gas/testsuite/gas/arm/thumbver.d new file mode 100644 index 00000000000..ddc46df56d4 --- /dev/null +++ b/gas/testsuite/gas/arm/thumbver.d @@ -0,0 +1,15 @@ +# as: -meabi=4 +# readelf: -s +# This test is only valid on ELF based ports. +#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix* + +Symbol table '\.symtab' contains .* entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 00000000 0 NOTYPE LOCAL DEFAULT UND + 1: 00000000 0 SECTION LOCAL DEFAULT 1 +#... + .*: 00000001 0 FUNC LOCAL DEFAULT 1 a_alias + .*: 00000001 0 FUNC LOCAL DEFAULT 1 a_body + .*: 00000000 0 NOTYPE LOCAL DEFAULT 1 \$t + .*: 00000001 0 FUNC LOCAL DEFAULT 1 a_export@VERSION +#... diff --git a/gas/testsuite/gas/arm/thumbver.s b/gas/testsuite/gas/arm/thumbver.s new file mode 100644 index 00000000000..ad81395ee40 --- /dev/null +++ b/gas/testsuite/gas/arm/thumbver.s @@ -0,0 +1,9 @@ +@ Check that symbols created by .symver are marked as Thumb. + + .thumb_set a_alias, a_body + .symver a_alias, a_export@VERSION + .type a_body, %function + .code 16 + .thumb_func +a_body: + nop -- 2.30.2