diff options
author | Nick Clifton <nickc@redhat.com> | 2005-01-04 10:20:36 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2005-01-04 10:20:36 +0000 |
commit | 18af0b39e6429361f1e3a93e63f045d5db1bed72 (patch) | |
tree | 034656a9e5b5e7777019eef4d41a87f29c3aa5ad /gas/config | |
parent | c9bc3b3d292e520e750db3fd2214481712d29d9c (diff) | |
download | gdb-18af0b39e6429361f1e3a93e63f045d5db1bed72.zip gdb-18af0b39e6429361f1e3a93e63f045d5db1bed72.tar.gz gdb-18af0b39e6429361f1e3a93e63f045d5db1bed72.tar.bz2 |
(md_apply_fix3): Fix offset calculation for global label.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-msp430.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c index d836578..d7a2082 100644 --- a/gas/config/tc-msp430.c +++ b/gas/config/tc-msp430.c @@ -1,6 +1,6 @@ /* tc-msp430.c -- Assembler code for the Texas Instruments MSP430 - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Dmitry Diky <diwil@mail.ru> This file is part of GAS, the GNU Assembler. @@ -1851,7 +1851,19 @@ md_apply_fix3 (fixS * fixp, valueT * valuep, segT seg) if (fixp->fx_addsy && (s == seg || s == absolute_section)) { - value = S_GET_VALUE (fixp->fx_addsy) + *valuep; + /* FIXME: We can appear here only in case if we perform a pc + relative jump to the label which is i) global, ii) locally + defined or this is a jump to an absolute symbol. + If this is an absolute symbol -- everything is OK. + If this is a global label, we've got a symbol value defined + twice: + 1. S_GET_VALUE (fixp->fx_addsy) will contain a symbol offset + from this section start + 2. *valuep will contain the real offset from jump insn to the + label + So, the result of S_GET_VALUE (fixp->fx_addsy) + (* valuep); + will be incorrect. Therefore remove s_get_value. */ + value = /* S_GET_VALUE (fixp->fx_addsy) + */ * valuep; fixp->fx_done = 1; } else |