/* read.c - read a source file -
- Copyright (C) 1986-2018 Free Software Foundation, Inc.
+ Copyright (C) 1986-2020 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
static bfd_boolean
in_bss (void)
{
- flagword flags = bfd_get_section_flags (stdoutput, now_seg);
+ flagword flags = bfd_section_flags (now_seg);
return (flags & SEC_ALLOC) && !(flags & (SEC_LOAD | SEC_HAS_CONTENTS));
}
{
char *s2 = s;
- strncpy (original_case_string, s2, sizeof (original_case_string));
+ strncpy (original_case_string, s2,
+ sizeof (original_case_string) - 1);
original_case_string[sizeof (original_case_string) - 1] = 0;
while (*s2)
if ((bfd_applicable_section_flags (stdoutput) & SEC_LINK_ONCE) == 0)
as_warn (_(".linkonce is not supported for this object file format"));
- flags = bfd_get_section_flags (stdoutput, now_seg);
+ flags = bfd_section_flags (now_seg);
flags |= SEC_LINK_ONCE;
switch (type)
{
flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS;
break;
}
- if (!bfd_set_section_flags (stdoutput, now_seg, flags))
+ if (!bfd_set_section_flags (now_seg, flags))
as_bad (_("bfd_set_section_flags: %s"),
bfd_errmsg (bfd_get_error ()));
}
{
bss_seg = subseg_new (".sbss", 1);
seg_info (bss_seg)->bss = 1;
- if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
+ if (!bfd_set_section_flags (bss_seg, SEC_ALLOC | SEC_SMALL_DATA))
as_warn (_("error setting flags for \".sbss\": %s"),
bfd_errmsg (bfd_get_error ()));
}
flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_READONLY | SEC_ROM;
if (flags != SEC_NO_FLAGS)
{
- if (!bfd_set_section_flags (stdoutput, seg, flags))
+ if (!bfd_set_section_flags (seg, flags))
as_warn (_("error setting flags for \"%s\": %s"),
- bfd_section_name (stdoutput, seg),
+ bfd_section_name (seg),
bfd_errmsg (bfd_get_error ()));
}
}
input_line_pointer++;
/* Return pointing just after end-of-line. */
- know (is_end_of_line[(unsigned char) input_line_pointer[-1]]);
+ if (input_line_pointer <= buffer_limit)
+ know (is_end_of_line[(unsigned char) input_line_pointer[-1]]);
}
/* Sets frag for given symbol to zero_address_frag, except when the
if (append_zero)
stringer_append_char (0, bitsize);
- know (input_line_pointer[-1] == '\"');
-
#if !defined(NO_LISTING) && defined (OBJ_ELF)
/* In ELF, when gcc is emitting DWARF 1 debugging output, it
will emit .string with a filename in the .debug section
c = get_single_number ();
stringer_append_char (c, bitsize);
if (*input_line_pointer != '>')
- as_bad (_("expected <nn>"));
-
+ {
+ as_bad (_("expected <nn>"));
+ ignore_rest_of_line ();
+ return;
+ }
input_line_pointer++;
break;
case ',':
bump_line_counters ();
break;
-#ifndef NO_STRING_ESCAPES
case '\\':
+ if (!TC_STRING_ESCAPES)
+ break;
switch (c = *input_line_pointer++ & CHAR_MASK)
{
case 'b':
break;
}
break;
-#endif /* ! defined (NO_STRING_ESCAPES) */
default:
break;
as_warn (_("truncated file `%s', %ld of %ld bytes read"),
path, bytes, count);
}
-done:
+ done:
if (binfile != NULL)
fclose (binfile);
if (path)
free (path);
path = filename;
-gotit:
+ gotit:
/* malloc Storage leak when file is found on path. FIXME-SOMEDAY. */
register_dependency (path);
input_scrub_insert_file (path);
overruns should not occur. Saves the current input line pointer so that
it can be restored by calling restore_ilp().
- Does not support recursion.
-
- FIXME: This function is currently only used by stabs.c but that
- should be extended to other files in the gas source directory. */
+ Does not support recursion. */
void
temp_ilp (char *buf)