aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@cygnus>1994-01-19 00:08:50 +0000
committerKen Raeburn <raeburn@cygnus>1994-01-19 00:08:50 +0000
commit19302e449a76098c24dad0f868e4535c227205af (patch)
treebab4bd5f053b27d573c92fe47835368b77503b17 /gas
parent4bda835f61a37df30c67b46bdcfe11b528b29615 (diff)
downloadgdb-19302e449a76098c24dad0f868e4535c227205af.zip
gdb-19302e449a76098c24dad0f868e4535c227205af.tar.gz
gdb-19302e449a76098c24dad0f868e4535c227205af.tar.bz2
* literal.c (add_to_literal_pool): Handle duplicates of values already written
to literal pool.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/literal.c16
2 files changed, 19 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index aa20605..47c6e89 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 18 19:05:32 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
+
+ * literal.c (add_to_literal_pool): Handle duplicates of values
+ already written to literal pool.
+
Tue Jan 18 17:23:52 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* config/obj-aout.c (obj_aout_frob_symbol): Try to get symbols
diff --git a/gas/literal.c b/gas/literal.c
index 5ae2ff2..d39aa8b 100644
--- a/gas/literal.c
+++ b/gas/literal.c
@@ -1,5 +1,6 @@
/* as.c - GAS literal pool management.
Copyright (C) 1994 Free Software Foundation, Inc.
+ Written by Ken Raeburn (raeburn@cygnus.com).
This file is part of GAS, the GNU Assembler.
@@ -49,6 +50,17 @@ add_to_literal_pool (sym, addend, sec, size)
valueT offset;
bfd_reloc_code_real_type reloc_type;
char *p;
+ segment_info_type *seginfo = seg_info (sec);
+ fixS *fixp;
+
+ offset = 0;
+ /* @@ This assumes all entries in a given section will be of the same
+ size... Probably correct, but unwise to rely on. */
+ for (fixp = seginfo->fix_root; fixp; fixp = fixp->fx_next, offset += size)
+ {
+ if (fixp->fx_addsy == sym && fixp->fx_offset == addend)
+ return offset;
+ }
subseg_set (sec, 0);
p = frag_more (size);
@@ -70,8 +82,8 @@ add_to_literal_pool (sym, addend, sec, size)
subseg_set (current_section, current_subsec);
- offset = seg_info (sec)->literal_pool_size;
- seg_info (sec)->literal_pool_size += size;
+ offset = seginfo->literal_pool_size;
+ seginfo->literal_pool_size += size;
return offset;
}