aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-01-19 18:57:04 +1030
committerAlan Modra <amodra@gmail.com>2015-01-19 19:37:46 +1030
commit740bdc67c057ee8012327420848eb134e1db4211 (patch)
tree5b62be60b72fb242cfe55b497abc9894afb6218e /gas/write.c
parent0ba38529f27a815a576bc07c85ceb65f6498ef5a (diff)
downloadgdb-740bdc67c057ee8012327420848eb134e1db4211.zip
gdb-740bdc67c057ee8012327420848eb134e1db4211.tar.gz
gdb-740bdc67c057ee8012327420848eb134e1db4211.tar.bz2
Extend .reloc to accept some BFD_RELOCs
Tests that bfd_perform_reloc doesn't freak over a NONE reloc at end of section. gas/ * read.c (s_reloc): Match BFD_RELOC_NONE, BFD_RELOC{8,16,32,64}. * write.c (get_frag_for_reloc): Allow match just past end of frag. gas/testsuite/ * gas/all/none.s, * gas/all/none.d: New test. * gas/all/gas.exp: Run it.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gas/write.c b/gas/write.c
index 15dc1c5..aefed29 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1184,6 +1184,11 @@ get_frag_for_reloc (fragS *last_frag,
&& r->u.b.r.address < f->fr_address + f->fr_fix)
return f;
+ for (f = seginfo->frchainP->frch_root; f != NULL; f = f->fr_next)
+ if (f->fr_address <= r->u.b.r.address
+ && r->u.b.r.address <= f->fr_address + f->fr_fix)
+ return f;
+
as_bad_where (r->file, r->line,
_("reloc not within (fixed part of) section"));
return NULL;