summaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2013-03-08 10:17:00 +0000
committerChung-Lin Tang <cltang@codesourcery.com>2013-03-08 10:17:00 +0000
commit4b728c64ce45b931b10bf83dcecb49e43bff5e87 (patch)
treef153e37bcc7163eb8144a1e85818107d1980bc13 /gas/write.c
parent4a8ac447d8600f9a1d659ef651fdf45b3d971fe6 (diff)
downloadbinutils-redhat-4b728c64ce45b931b10bf83dcecb49e43bff5e87.tar.gz
2013-03-08 Chung-Lin Tang <cltang@codesourcery.com>
* write.h (struct fix): Add fx_dot_frag field. (dot_frag): Declare. * write.c (dot_frag): New variable. (fix_new_internal): Set fx_dot_frag field with dot_frag. (fixup_segment): Base calculation of fx_offset with fx_dot_frag. * expr.c (expr): Save value of frag_now in dot_frag when setting dot_value. * read.c (emit_expr): Likewise. Delete comments.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gas/write.c b/gas/write.c
index 1d27db782e..22e68c5ec8 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -122,6 +122,9 @@ symbolS *abs_section_sym;
/* Remember the value of dot when parsing expressions. */
addressT dot_value;
+/* The frag that dot_value is based from. */
+fragS *dot_frag;
+
/* Relocs generated by ".reloc" pseudo. */
struct reloc_list* reloc_list;
@@ -169,6 +172,7 @@ fix_new_internal (fragS *frag, /* Which frag? */
fixP->fx_subsy = sub_symbol;
fixP->fx_offset = offset;
fixP->fx_dot_value = dot_value;
+ fixP->fx_dot_frag = dot_frag;
fixP->fx_pcrel = pcrel;
fixP->fx_r_type = r_type;
fixP->fx_im_disp = 0;
@@ -977,7 +981,7 @@ fixup_segment (fixS *fixP, segT this_segment)
{
add_number -= S_GET_VALUE (fixP->fx_subsy);
fixP->fx_offset = (add_number + fixP->fx_dot_value
- + fixP->fx_frag->fr_address);
+ + fixP->fx_dot_frag->fr_address);
/* Make it pc-relative. If the back-end code has not
selected a pc-relative reloc, cancel the adjustment