From 0f020cefaaafef23c09c563bb2f39794117a9748 Mon Sep 17 00:00:00 2001 From: Jie Zhang Date: Fri, 19 Mar 2010 14:43:09 +0000 Subject: [PATCH] * config/tc-arm.c (make_mapping_symbol): Hanle the case that two mapping symbols have the same value. testsuite/ * gas/arm/mapmisc.s: Add the test case for two mapping symbols having the same value. * gas/arm/mapmisc.d: Likewise. --- gas/ChangeLog | 5 +++++ gas/config/tc-arm.c | 10 +++++++++- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/arm/mapmisc.d | 2 ++ gas/testsuite/gas/arm/mapmisc.s | 2 ++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 4736a3a28c..8936235db5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2010-03-19 Jie Zhang + + * config/tc-arm.c (make_mapping_symbol): Hanle the case + that two mapping symbols have the same value. + 2010-03-18 Daniel Jacobowitz * doc/c-arm.texi (.setfp): Correct example. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 557b9f910e..117812d846 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -2500,7 +2500,15 @@ make_mapping_symbol (enum mstate state, valueT value, fragS *frag) frag->tc_frag_data.first_map = symbolP; } if (frag->tc_frag_data.last_map != NULL) - know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP)); + { + know (S_GET_VALUE (frag->tc_frag_data.last_map) <= S_GET_VALUE (symbolP)); + /* If .fill or other data filling directive generates zero sized data, + the mapping symbol for the following code will have the same value + as the one generated for the data filling directive. In this case, + we replace the old symbol with the new one at the same address. */ + if (S_GET_VALUE (frag->tc_frag_data.last_map) == S_GET_VALUE (symbolP)) + symbol_remove (frag->tc_frag_data.last_map, &symbol_rootP, &symbol_lastP); + } frag->tc_frag_data.last_map = symbolP; } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 86d14dc011..bf25c724a4 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-03-19 Jie Zhang + + * gas/arm/mapmisc.s: Add the test case for two mapping + symbols having the same value. + * gas/arm/mapmisc.d: Likewise. + 2010-03-18 Wei Guozhi PR gas/11323 diff --git a/gas/testsuite/gas/arm/mapmisc.d b/gas/testsuite/gas/arm/mapmisc.d index 51170216dc..c130b65d3d 100644 --- a/gas/testsuite/gas/arm/mapmisc.d +++ b/gas/testsuite/gas/arm/mapmisc.d @@ -46,6 +46,7 @@ SYMBOL TABLE: 0+9c l .text 00000000 \$a 0+a0 l .text 00000000 \$d 0+a4 l .text 00000000 \$a +0+a8 l .text 00000000 \$a 0+00 l d .ARM.attributes 00000000 .ARM.attributes @@ -93,3 +94,4 @@ Disassembly of section .text: 9c: e1a00000 nop ; \(mov r0, r0\) a0: 7778797a .word 0x7778797a a4: e1a00000 nop ; \(mov r0, r0\) + a8: e1a00000 nop ; \(mov r0, r0\) diff --git a/gas/testsuite/gas/arm/mapmisc.s b/gas/testsuite/gas/arm/mapmisc.s index 25d9a73938..4749e8daab 100644 --- a/gas/testsuite/gas/arm/mapmisc.s +++ b/gas/testsuite/gas/arm/mapmisc.s @@ -34,3 +34,5 @@ foo: nop .incbin "mapmisc.dat" nop + .fill 0, 0, 0 + nop