aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-03-18 11:21:33 +0000
committerAlan Modra <amodra@gmail.com>2011-03-18 11:21:33 +0000
commit869fe6ea8574b6af5e365170b2416cee0dfbfbfe (patch)
tree15228c1f1247897582c2fb45d1461f60dd38982d /gas
parent144886fa6bdc77ca109153ea4a58e886a36ffff2 (diff)
downloadgdb-869fe6ea8574b6af5e365170b2416cee0dfbfbfe.zip
gdb-869fe6ea8574b6af5e365170b2416cee0dfbfbfe.tar.gz
gdb-869fe6ea8574b6af5e365170b2416cee0dfbfbfe.tar.bz2
* config/obj-elf.c (elf_frob_symbol): Report S_SET_SIZE symbol
on .size expression errors rather than symbols in the size expression.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/obj-elf.c45
2 files changed, 9 insertions, 41 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 9f65957..a2a43cd 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2011-03-18 Alan Modra <amodra@gmail.com>
+ * config/obj-elf.c (elf_frob_symbol): Report S_SET_SIZE symbol
+ on .size expression errors rather than symbols in the size expression.
+
+2011-03-18 Alan Modra <amodra@gmail.com>
+
* input-scrub.c (line_numberT): Delete.
(input_scrub_close): Reset line counters.
* messages.c (as_show_where): Don't print invalid line number.
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 37a8020..afb4811 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1896,49 +1896,12 @@ elf_frob_symbol (symbolS *symp, int *puntp)
S_SET_SIZE (symp, size->X_add_number);
else
{
- const char *op_name = NULL;
- const char *add_name = NULL;
- PRINTF_LIKE ((*as_error));
-
if (flag_size_check == size_check_error)
- as_error = as_bad;
+ as_bad (_(".size expression for %s "
+ "does not evaluate to a constant"), S_GET_NAME (symp));
else
- as_error = as_warn;
-
- if (size->X_op == O_subtract)
- {
- op_name = S_GET_NAME (size->X_op_symbol);
- add_name = S_GET_NAME (size->X_add_symbol);
- if (strcmp (op_name, FAKE_LABEL_NAME) == 0)
- op_name = NULL;
- if (strcmp (add_name, FAKE_LABEL_NAME) == 0)
- add_name = NULL;
-
- if (op_name && add_name)
- as_error (_(".size expression with symbols `%s' and "
- "`%s' does not evaluate to a constant"),
- op_name, add_name);
- else
- {
- const char *name;
-
- if (op_name)
- name = op_name;
- else if (add_name)
- name = add_name;
- else
- name = NULL;
-
- if (name)
- as_error (_(".size expression with symbol `%s' "
- "does not evaluate to a constant"),
- name);
- }
- }
-
- if (!op_name && !add_name)
- as_error (_(".size expression does not evaluate to a "
- "constant"));
+ as_warn (_(".size expression for %s "
+ "does not evaluate to a constant"), S_GET_NAME (symp));
}
free (sy_obj->size);
sy_obj->size = NULL;