/* Support for the generic parts of COFF, for BFD.
- Copyright (C) 1990-2021 Free Software Foundation, Inc.
+ Copyright (C) 1990-2022 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
{
BFD_ASSERT (! (native + j + 1)->is_sym);
- if (native->u.syment.n_sclass == C_FILE && j > 0)
+ /* Adjust auxent only if this isn't the filename
+ auxiliary entry. */
+ if (native->u.syment.n_sclass == C_FILE
+ && (native + j + 1)->u.auxent.x_file.x_ftype)
coff_write_auxent_fname (abfd, (char *) (native + j + 1)->extrap,
&(native + j + 1)->u.auxent, string_size_p);
memset (isym, 0, sizeof (*isym));
return true;
}
+ memset (dummy, 0, sizeof dummy);
native = dummy;
native->is_sym = true;
native[1].is_sym = false;
char *str;
size_t str_length;
+ /* Add strings from aux entries only if this isn't the
+ filename auxiliary entry. */
+ if (!c_symbol->native[j + 1].u.auxent.x_file.x_ftype)
+ continue;
+
if (c_symbol->native[j + 1].u.auxent.x_file.x_n.x_fname[0] != 0)
continue;
if (coffsymbol (symbol)->native != NULL
&& coffsymbol (symbol)->native->fix_value
&& coffsymbol (symbol)->native->is_sym)
- ret->value =
- ((coffsymbol (symbol)->native->u.syment.n_value -
- (bfd_hostptr_t) obj_raw_syments (abfd))
- / sizeof (combined_entry_type));
+ ret->value
+ = (((bfd_hostptr_t) coffsymbol (symbol)->native->u.syment.n_value
+ - (bfd_hostptr_t) obj_raw_syments (abfd))
+ / sizeof (combined_entry_type));
}
/* Print out information about COFF symbol. */
if (! combined->fix_value)
val = (bfd_vma) combined->u.syment.n_value;
else
- val = ((combined->u.syment.n_value - (bfd_hostptr_t) root)
+ val = (((bfd_hostptr_t) combined->u.syment.n_value
+ - (bfd_hostptr_t) root)
/ sizeof (combined_entry_type));
- fprintf (file, "(sec %2d)(fl 0x%02x)(ty %3x)(scl %3d) (nx %d) 0x",
+ fprintf (file, "(sec %2d)(fl 0x%02x)(ty %4x)(scl %3d) (nx %d) 0x",
combined->u.syment.n_scnum,
combined->u.syment.n_flags,
combined->u.syment.n_type,
fprintf (file, "File ");
/* Add additional information if this isn't the filename
auxiliary entry. */
- if (aux)
+ if (auxp->u.auxent.x_file.x_ftype)
fprintf (file, "ftype %d fname \"%s\"",
auxp->u.auxent.x_file.x_ftype,
(char *) auxp->u.auxent.x_file.x_n.x_n.x_offset);
}
if (sec_data != NULL && sec_data->saved_bias)
- bias = sec_data->saved_bias;
+ bias = sec_data->bias;
else if (symbols)
{
bias = _bfd_dwarf2_find_symbol_bias (symbols,