/* a.out object file format
- Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2010
- Free Software Foundation, Inc.
+ Copyright (C) 1989-2019 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#include "as.h"
#undef NO_RELOC
#include "aout/aout64.h"
-#include "obstack.h"
void
obj_aout_frob_symbol (symbolS *sym, int *punt ATTRIBUTE_UNUSED)
if (! (type & ~ (N_TYPE | N_EXT)))
{
if (type == (N_UNDF | N_EXT)
- && sec == &bfd_abs_section)
+ && sec == bfd_abs_section_ptr)
{
sec = bfd_und_section_ptr;
S_SET_SEGMENT (sym, sec);
&& (type & N_TYPE) != N_SETD
&& (type & N_TYPE) != N_SETB
&& type != N_WARNING
- && (sec == &bfd_abs_section
- || sec == &bfd_und_section))
+ && (sec == bfd_abs_section_ptr
+ || sec == bfd_und_section_ptr))
return;
if (flags & BSF_EXPORT)
type |= N_EXT;
{
/* Relocation processing may require knowing the VMAs of the sections.
Since writing to a section will cause the BFD back end to compute the
- VMAs, fake it out here.... */
- bfd_byte b = 0;
- bfd_boolean x = TRUE;
- if (bfd_section_size (stdoutput, text_section) != 0)
- x = bfd_set_section_contents (stdoutput, text_section, &b, (file_ptr) 0,
- (bfd_size_type) 1);
- else if (bfd_section_size (stdoutput, data_section) != 0)
- x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0,
- (bfd_size_type) 1);
-
- gas_assert (x);
+ VMAs, fake it out here....
+ Writing to the end of the section ensures the file contents
+ extend to cover the entire aligned size. We possibly won't know
+ the aligned size until after VMAs and sizes are set on the first
+ bfd_set_section_contents call, so it might be necessary to repeat. */
+ asection *sec = NULL;
+ if (data_section->size != 0)
+ sec = data_section;
+ else if (text_section->size != 0)
+ sec = text_section;
+ if (sec)
+ {
+ bfd_size_type size;
+ do
+ {
+ bfd_byte b = 0;
+ size = sec->size;
+ gas_assert (bfd_set_section_contents (stdoutput, sec, &b,
+ size - 1, (bfd_size_type) 1));
+ } while (size != sec->size);
+ }
}
static void
do
{
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
symbolP = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
S_SET_WEAK (symbolP);
if (c == ',')
int c;
symbolS *sym;
- name = input_line_pointer;
- c = get_symbol_end ();
+ c = get_symbol_name (&name);
sym = symbol_find_or_make (name);
- *input_line_pointer = c;
+ (void) restore_line_pointer (c);
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
{