static void obj_elf_change_section PARAMS ((char *, int, int, int, int));
static int obj_elf_parse_section_letters PARAMS ((char *, size_t));
static int obj_elf_section_word PARAMS ((char *, size_t));
+static char *obj_elf_section_name PARAMS ((void));
static int obj_elf_section_type PARAMS ((char *, size_t));
static void obj_elf_symver PARAMS ((int));
static void obj_elf_subsection PARAMS ((int));
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
{
- as_bad (_("Expected comma after symbol-name"));
+ as_bad (_("expected comma after symbol-name"));
ignore_rest_of_line ();
return;
}
*p = c;
if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
{
- as_bad (_("Ignoring attempt to re-define symbol"));
+ as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP));
ignore_rest_of_line ();
return;
}
{
if (S_GET_VALUE (symbolP) != (valueT) size)
{
- as_warn (_("Length of .comm \"%s\" is already %ld. Not changed to %d."),
+ as_warn (_("length of .comm \"%s\" is already %ld; not changed to %d"),
S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
}
}
if (temp < 0)
{
temp = 0;
- as_warn (_("Common alignment negative; 0 assumed"));
+ as_warn (_("common alignment negative; 0 assumed"));
}
}
if (symbol_get_obj (symbolP)->local)
for (align = 0; (temp & 1) == 0; temp >>= 1, ++align);
if (temp != 1)
{
- as_bad (_("Common alignment not a power of 2"));
+ as_bad (_("common alignment not a power of 2"));
ignore_rest_of_line ();
return;
}
{
if (old_sec == NULL)
{
- as_warn (_("Setting incorrect section type for %s"), name);
+ as_warn (_("setting incorrect section type for %s"), name);
}
else
{
- as_warn (_("Ignoring incorrect section type for %s"), name);
+ as_warn (_("ignoring incorrect section type for %s"), name);
type = special_sections[i].type;
}
}
file. */
if (strcmp (name, ".note") != 0
|| attr != SHF_ALLOC)
- as_warn (_("Setting incorrect section attributes for %s"),
+ as_warn (_("setting incorrect section attributes for %s"),
name);
}
attr |= special_sections[i].attributes;
if ((old_sec->flags ^ flags)
& (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
| SEC_EXCLUDE | SEC_SORT_ENTRIES | SEC_MERGE | SEC_STRINGS))
- as_warn (_("Ignoring changed section attributes for %s"), name);
+ as_warn (_("ignoring changed section attributes for %s"), name);
else if ((flags & SEC_MERGE) && old_sec->entsize != (unsigned) entsize)
- as_warn (_("Ignoring changed section entity size for %s"), name);
+ as_warn (_("ignoring changed section entity size for %s"), name);
}
#ifdef md_elf_section_change_hook
}
default:
{
- char *bad_msg = _("Unrecognized .section attribute: want a,w,x,M,S");
+ char *bad_msg = _("unrecognized .section attribute: want a,w,x,M,S");
#ifdef md_elf_section_letter
int md_attr = md_elf_section_letter (*str, &bad_msg);
if (md_attr >= 0)
}
#endif
- as_warn (_("Unrecognized section attribute"));
+ as_warn (_("unrecognized section attribute"));
return 0;
}
}
#endif
- as_warn (_("Unrecognized section type"));
+ as_warn (_("unrecognized section type"));
return 0;
}
+/* Get name of section. */
+static char *
+obj_elf_section_name ()
+{
+ char *name;
+
+ SKIP_WHITESPACE ();
+ if (*input_line_pointer == '"')
+ {
+ int dummy;
+
+ name = demand_copy_C_string (&dummy);
+ if (name == NULL)
+ {
+ ignore_rest_of_line ();
+ return NULL;
+ }
+ }
+ else
+ {
+ char *end = input_line_pointer;
+
+ while (0 == strchr ("\n\t,; ", *end))
+ end++;
+ if (end == input_line_pointer)
+ {
+ as_warn (_("missing name"));
+ ignore_rest_of_line ();
+ return NULL;
+ }
+
+ name = xmalloc (end - input_line_pointer + 1);
+ memcpy (name, input_line_pointer, end - input_line_pointer);
+ name[end - input_line_pointer] = '\0';
+ input_line_pointer = end;
+ }
+ SKIP_WHITESPACE ();
+ return name;
+}
+
void
obj_elf_section (push)
int push;
{
- char *name, *beg, *end;
+ char *name, *beg;
int type, attr, dummy;
int entsize;
}
#endif /* ! defined (TC_I370) */
- /* Get name of section. */
- SKIP_WHITESPACE ();
- if (*input_line_pointer == '"')
- {
- name = demand_copy_C_string (&dummy);
- if (name == NULL)
- {
- ignore_rest_of_line ();
- return;
- }
- }
- else
- {
- end = input_line_pointer;
- while (0 == strchr ("\n\t,; ", *end))
- end++;
- if (end == input_line_pointer)
- {
- as_warn (_("Missing section name"));
- ignore_rest_of_line ();
- return;
- }
-
- name = xmalloc (end - input_line_pointer + 1);
- memcpy (name, input_line_pointer, end - input_line_pointer);
- name[end - input_line_pointer] = '\0';
- input_line_pointer = end;
- }
- SKIP_WHITESPACE ();
-
+ name = obj_elf_section_name ();
+ if (name == NULL)
+ return;
type = SHT_NULL;
attr = 0;
entsize = 0;
}
SKIP_WHITESPACE ();
- if ((attr & SHF_MERGE) && *input_line_pointer == ',')
+ if ((attr & SHF_MERGE) != 0 && *input_line_pointer == ',')
{
++input_line_pointer;
SKIP_WHITESPACE ();
entsize = get_absolute_expression ();
+ SKIP_WHITESPACE ();
if (entsize < 0)
{
- as_warn (_("Bad .section directive - invalid merge entity size"));
+ as_warn (_("invalid merge entity size"));
attr &= ~SHF_MERGE;
entsize = 0;
}
}
+ else if ((attr & SHF_MERGE) != 0)
+ {
+ as_warn (_("entity size for SHF_MERGE not specified"));
+ attr &= ~SHF_MERGE;
+ }
}
else
{
SKIP_WHITESPACE ();
if (*input_line_pointer != '#')
{
- as_warn (_("Bad .section directive - character following name is not '#'"));
+ as_warn (_("character following name is not '#'"));
ignore_rest_of_line ();
return;
}
demand_empty_rest_of_line ();
- if ((attr & SHF_MERGE) && entsize == 0)
- {
- as_warn (_("Entity size for SHF_MERGE not specified.\nSpecify entity size as 4th argument"));
- attr &= SHF_MERGE;
- }
-
obj_elf_change_section (name, type, attr, entsize, push);
}
if (previous_section == 0)
{
- as_bad (_(".previous without corresponding .section; ignored"));
+ as_warn (_(".previous without corresponding .section; ignored"));
return;
}
if (top == NULL)
{
- as_bad (_(".popsection without corresponding .pushsection; ignored"));
+ as_warn (_(".popsection without corresponding .pushsection; ignored"));
return;
}
}
else
{
- as_bad (_("Expected quoted string"));
+ as_bad (_("expected quoted string"));
}
demand_empty_rest_of_line ();
}
;
#endif
else
- as_bad (_("ignoring unrecognized symbol type \"%s\""), typename);
+ as_bad (_("unrecognized symbol type \"%s\""), typename);
*input_line_pointer = c;
if (S_IS_WEAK (symp))
{
if (S_IS_COMMON (symp))
- as_bad (_("Symbol `%s' can not be both weak and common"),
+ as_bad (_("symbol `%s' can not be both weak and common"),
S_GET_NAME (symp));
}
debug.external_ext = debug.external_ext_end = NULL;
if (! bfd_ecoff_debug_externals (stdoutput, &debug, debug_swap, true,
elf_get_extr, elf_set_index))
- as_fatal (_("Failed to set up debugging information: %s"),
+ as_fatal (_("failed to set up debugging information: %s"),
bfd_errmsg (bfd_get_error ()));
sec = bfd_get_section_by_name (stdoutput, ".mdebug");
pointer will not be used. */
if (! bfd_set_section_contents (stdoutput, sec, (PTR) buf,
(file_ptr) 0, (bfd_size_type) 0))
- as_fatal (_("Can't start writing .mdebug section: %s"),
+ as_fatal (_("can't start writing .mdebug section: %s"),
bfd_errmsg (bfd_get_error ()));
know (stdoutput->output_has_begun == true);
if (! bfd_ecoff_write_debug (stdoutput, &debug, debug_swap,
sec->filepos))
- as_fatal (_("Could not write .mdebug section: %s"),
+ as_fatal (_("could not write .mdebug section: %s"),
bfd_errmsg (bfd_get_error ()));
}
#endif /* NEED_ECOFF_DEBUG */