aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-09-19 23:51:35 +0000
committerAlan Modra <amodra@gmail.com>2002-09-19 23:51:35 +0000
commit263462410cf8a0857c75b40cfc1f800f88c743b7 (patch)
tree11ad589fbf7659038e9900ecb265318c1821921b /gas/write.c
parent2f870471d434335b998b1af09805b8955ff6b262 (diff)
downloadgdb-263462410cf8a0857c75b40cfc1f800f88c743b7.zip
gdb-263462410cf8a0857c75b40cfc1f800f88c743b7.tar.gz
gdb-263462410cf8a0857c75b40cfc1f800f88c743b7.tar.bz2
* write.h (struct fix): Add fx_dot_value.
(dot_value): Declare. * write.c (dot_value): New var. (fix_new_internal): Save dot_value as fx_dot_value. * expr.c (expr): Update dot_value.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gas/write.c b/gas/write.c
index 17c3232..4ee6a7d 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -111,6 +111,9 @@ int symbol_table_frozen;
symbolS *abs_section_sym;
+/* Remember the value of dot when parsing expressions. */
+addressT dot_value;
+
void print_fixup PARAMS ((fixS *));
#ifdef BFD_ASSEMBLER
@@ -220,6 +223,7 @@ fix_new_internal (frag, where, size, add_symbol, sub_symbol, offset, pcrel,
fixP->fx_addsy = add_symbol;
fixP->fx_subsy = sub_symbol;
fixP->fx_offset = offset;
+ fixP->fx_dot_value = dot_value;
fixP->fx_pcrel = pcrel;
fixP->fx_plt = 0;
#if defined(NEED_FX_R_TYPE) || defined (BFD_ASSEMBLER)
@@ -2656,7 +2660,8 @@ fixup_segment (fixP, this_segment)
&& !TC_FORCE_RELOCATION_SUB_LOCAL (fixP))
{
add_number -= S_GET_VALUE (fixP->fx_subsy);
- fixP->fx_offset = add_number;
+ fixP->fx_offset = (add_number + fixP->fx_dot_value
+ + fixP->fx_frag->fr_address);
/* Make it pc-relative. If the back-end code has not
selected a pc-relative reloc, cancel the adjustment