aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-07-02 11:12:29 +0000
committerNick Clifton <nickc@redhat.com>2004-07-02 11:12:29 +0000
commit310ea3086d7cb622cc93fb7dbc127e206f070a7a (patch)
tree96381f9e7d25e026eb0660633b748e9e8b76da7e
parent6a9cf61e0fb67ba9df9ddd800cc8a4c272f91795 (diff)
downloadgdb-310ea3086d7cb622cc93fb7dbc127e206f070a7a.zip
gdb-310ea3086d7cb622cc93fb7dbc127e206f070a7a.tar.gz
gdb-310ea3086d7cb622cc93fb7dbc127e206f070a7a.tar.bz2
(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come
from undefined symbols. Always consider this fixup to have been processed as a reloc cannot be generated for it.
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-arm.c15
2 files changed, 21 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ab0551e..42968c0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-02 Nick Clifton <nickc@redhat.com>
+
+ * config/tc-arm.c (md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not
+ allow values which have come from undefined symbols.
+ Always consider this fixup to have been processed as a reloc
+ cannot be generated for it.
+
2004-07-02 Alan Modra <amodra@bigpond.net.au>
* frags.h (struct frag): Add has_code and insn_addr fields.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 3f21c84..da7fcea 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -12186,6 +12186,20 @@ md_apply_fix3 (fixP, valP, seg)
switch (fixP->fx_r_type)
{
case BFD_RELOC_ARM_IMMEDIATE:
+ /* We claim that this fixup has been processed here,
+ even if in fact we generate an error because we do
+ not have a reloc for it, so tc_gen_reloc will reject it. */
+ fixP->fx_done = 1;
+
+ if (fixP->fx_addsy
+ && ! S_IS_DEFINED (fixP->fx_addsy))
+ {
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("undefined symbol %s used as an immediate value"),
+ S_GET_NAME (fixP->fx_addsy));
+ break;
+ }
+
newimm = validate_immediate (value);
temp = md_chars_to_number (buf, INSN_SIZE);
@@ -12202,7 +12216,6 @@ md_apply_fix3 (fixP, valP, seg)
newimm |= (temp & 0xfffff000);
md_number_to_chars (buf, (valueT) newimm, INSN_SIZE);
- fixP->fx_done = 1;
break;
case BFD_RELOC_ARM_ADRL_IMMEDIATE: