aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-08-01 11:27:14 +0000
committerNick Clifton <nickc@redhat.com>2011-08-01 11:27:14 +0000
commita8040cf231c4b78568493e8f6822ea8943882ad6 (patch)
tree05c169b1367bb684f2cd21aa2ac2d32c1456bb90 /gas
parent1596988d5336b79609a5efca3d200a4cf0d58829 (diff)
downloadgdb-a8040cf231c4b78568493e8f6822ea8943882ad6.zip
gdb-a8040cf231c4b78568493e8f6822ea8943882ad6.tar.gz
gdb-a8040cf231c4b78568493e8f6822ea8943882ad6.tar.bz2
PR ld/12974
* config/tc-arm.c (literal_pool): Add locs field. (add_to_lit_pool): Initialise the locs entry for the new literal. (s_ltorg): Generate a DWARF2 line number entry for each emitted literal pool entry.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-arm.c21
2 files changed, 27 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6af662a..8c0e298 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+2011-08-01 Nick Clifton <nickc@redhat.com>
+
+ PR ld/12974
+ * config/tc-arm.c (literal_pool): Add locs field.
+ (add_to_lit_pool): Initialise the locs entry for the new literal.
+ (s_ltorg): Generate a DWARF2 line number entry for each emitted
+ literal pool entry.
+
2011-08-01 Tristan Gingold <gingold@adacore.com>
* write.c (write_relocs): Fix -Wshadow in DEBUG3 and DEBUG4.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 1592322..b018b4f 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -759,6 +759,9 @@ typedef struct literal_pool
symbolS * symbol;
segT section;
subsegT sub_section;
+#ifdef OBJ_ELF
+ struct dwarf2_line_info locs [MAX_LITERAL_POOL_SIZE];
+#endif
struct literal_pool * next;
} literal_pool;
@@ -3074,6 +3077,14 @@ add_to_lit_pool (void)
}
pool->literals[entry] = inst.reloc.exp;
+#ifdef OBJ_ELF
+ /* PR ld/12974: Record the location of the first source line to reference
+ this entry in the literal pool. If it turns out during linking that the
+ symbol does not exist we will be able to give an accurate line number for
+ the (first use of the) missing reference. */
+ if (debug_type == DEBUG_DWARF2)
+ dwarf2_where (pool->locs + entry);
+#endif
pool->next_free_entry += 1;
}
@@ -3171,8 +3182,14 @@ s_ltorg (int ignored ATTRIBUTE_UNUSED)
#endif
for (entry = 0; entry < pool->next_free_entry; entry ++)
- /* First output the expression in the instruction to the pool. */
- emit_expr (&(pool->literals[entry]), 4); /* .word */
+ {
+#ifdef OBJ_ELF
+ if (debug_type == DEBUG_DWARF2)
+ dwarf2_gen_line_info (frag_now_fix (), pool->locs + entry);
+#endif
+ /* First output the expression in the instruction to the pool. */
+ emit_expr (&(pool->literals[entry]), 4); /* .word */
+ }
/* Mark the pool as empty. */
pool->next_free_entry = 0;