}
lsec = bfd_get_section_by_name (abfd, ".loader");
- if (lsec == NULL)
+ if (lsec == NULL || (lsec->flags & SEC_HAS_CONTENTS) == 0)
{
bfd_set_error (bfd_error_no_symbols);
return -1;
}
lsec = bfd_get_section_by_name (abfd, ".loader");
- if (lsec == NULL)
+ if (lsec == NULL || (lsec->flags & SEC_HAS_CONTENTS) == 0)
{
bfd_set_error (bfd_error_no_symbols);
return -1;
}
lsec = bfd_get_section_by_name (abfd, ".loader");
- if (lsec == NULL)
+ if (lsec == NULL || (lsec->flags & SEC_HAS_CONTENTS) == 0)
{
bfd_set_error (bfd_error_no_symbols);
return -1;
}
lsec = bfd_get_section_by_name (abfd, ".loader");
- if (lsec == NULL)
+ if (lsec == NULL || (lsec->flags & SEC_HAS_CONTENTS) == 0)
{
bfd_set_error (bfd_error_no_symbols);
return -1;
o_snloader field in the a.out header, rather than grabbing the
section by name. */
lsec = bfd_get_section_by_name (abfd, ".loader");
- if (lsec == NULL)
+ if (lsec == NULL || (lsec->flags & SEC_HAS_CONTENTS) == 0)
{
_bfd_error_handler
(_("%pB: dynamic object with no .loader section"),
/* This is an external reference. */
if (sym.n_sclass == C_HIDEXT
|| sym.n_scnum != N_UNDEF
- || aux.x_csect.x_scnlen.l != 0)
+ || aux.x_csect.x_scnlen.u64 != 0)
{
_bfd_error_handler
/* xgettext:c-format */
(_("%pB: bad XTY_ER symbol `%s': class %d scnum %d "
"scnlen %" PRId64),
abfd, name, sym.n_sclass, sym.n_scnum,
- (int64_t) aux.x_csect.x_scnlen.l);
+ aux.x_csect.x_scnlen.u64);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
if (aux.x_csect.x_smclas == XMC_TC0)
{
if (sym.n_sclass != C_HIDEXT
- || aux.x_csect.x_scnlen.l != 0)
+ || aux.x_csect.x_scnlen.u64 != 0)
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: XMC_TC0 symbol `%s' is class %d scnlen %" PRId64),
- abfd, name, sym.n_sclass, (int64_t) aux.x_csect.x_scnlen.l);
+ (_("%pB: XMC_TC0 symbol `%s' is class %d scnlen %" PRIu64),
+ abfd, name, sym.n_sclass, aux.x_csect.x_scnlen.u64);
bfd_set_error (bfd_error_bad_value);
goto error_return;
}
&& sym.n_sclass == C_HIDEXT
&& info->output_bfd->xvec == abfd->xvec
&& ((bfd_xcoff_is_xcoff32 (abfd)
- && aux.x_csect.x_scnlen.l == 4)
+ && aux.x_csect.x_scnlen.u64 == 4)
|| (bfd_xcoff_is_xcoff64 (abfd)
- && aux.x_csect.x_scnlen.l == 8)))
+ && aux.x_csect.x_scnlen.u64 == 8)))
{
asection *enclosing;
struct internal_reloc *relocs;
if (! bfd_is_abs_section (enclosing)
&& ((bfd_vma) sym.n_value < enclosing->vma
- || ((bfd_vma) sym.n_value + aux.x_csect.x_scnlen.l
+ || (sym.n_value + aux.x_csect.x_scnlen.u64
> enclosing->vma + enclosing->size)))
{
_bfd_error_handler
csect->filepos = (enclosing->filepos
+ sym.n_value
- enclosing->vma);
- csect->size = aux.x_csect.x_scnlen.l;
- csect->rawsize = aux.x_csect.x_scnlen.l;
+ csect->size = aux.x_csect.x_scnlen.u64;
+ csect->rawsize = aux.x_csect.x_scnlen.u64;
csect->flags |= SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp);
bool bad;
bad = false;
- if (aux.x_csect.x_scnlen.l < 0
- || (aux.x_csect.x_scnlen.l
- >= esym - (bfd_byte *) obj_coff_external_syms (abfd)))
+ if (aux.x_csect.x_scnlen.u64
+ >= (size_t) (esym - (bfd_byte *) obj_coff_external_syms (abfd)))
bad = true;
if (! bad)
{
- section = xcoff_data (abfd)->csects[aux.x_csect.x_scnlen.l];
+ section = xcoff_data (abfd)->csects[aux.x_csect.x_scnlen.u64];
if (section == NULL
|| (section->flags & SEC_HAS_CONTENTS) == 0)
bad = true;
if (csect == NULL)
goto error_return;
csect->vma = sym.n_value;
- csect->size = aux.x_csect.x_scnlen.l;
+ csect->size = aux.x_csect.x_scnlen.u64;
csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp);
/* There are a number of other fields and section flags
which we do not bother to set. */
csect->flags |= SEC_IS_COMMON;
csect->size = 0;
section = csect;
- value = aux.x_csect.x_scnlen.l;
+ value = aux.x_csect.x_scnlen.u64;
}
break;
*pneeded = false;
lsec = bfd_get_section_by_name (abfd, ".loader");
- if (lsec == NULL)
+ if (lsec == NULL || (lsec->flags & SEC_HAS_CONTENTS) == 0)
/* There are no symbols, so don't try to include it. */
return true;
{
/* Grab the contents of SUB's .debug section, if any. */
subdeb = bfd_get_section_by_name (sub, ".debug");
- if (subdeb != NULL && subdeb->size > 0)
+ if (subdeb != NULL
+ && subdeb->size != 0
+ && (subdeb->flags & SEC_HAS_CONTENTS) != 0)
{
/* We use malloc and copy the names into the debug
stringtab, rather than bfd_alloc, because I expect
{
unsigned long indx;
- indx = aux.x_csect.x_scnlen.l;
+ indx = aux.x_csect.x_scnlen.u64;
if (indx < obj_raw_syment_count (input_bfd))
{
long symindx;
symindx = flinfo->sym_indices[indx];
if (symindx < 0)
{
- aux.x_csect.x_scnlen.l = 0;
+ aux.x_csect.x_scnlen.u64 = 0;
}
else
{
- aux.x_csect.x_scnlen.l = symindx;
+ aux.x_csect.x_scnlen.u64 = symindx;
}
}
}
|| isymp->n_sclass == C_BLOCK
|| isymp->n_sclass == C_FCN)
{
- indx = aux.x_sym.x_fcnary.x_fcn.x_endndx.l;
+ indx = aux.x_sym.x_fcnary.x_fcn.x_endndx.u32;
if (indx > 0
&& indx < obj_raw_syment_count (input_bfd))
{
indx = output_index;
else
indx = flinfo->sym_indices[indx];
- aux.x_sym.x_fcnary.x_fcn.x_endndx.l = indx;
+ aux.x_sym.x_fcnary.x_fcn.x_endndx.u32 = indx;
}
}
- indx = aux.x_sym.x_tagndx.l;
+ indx = aux.x_sym.x_tagndx.u32;
if (indx > 0 && indx < obj_raw_syment_count (input_bfd))
{
long symindx;
symindx = flinfo->sym_indices[indx];
if (symindx < 0)
- aux.x_sym.x_tagndx.l = 0;
+ aux.x_sym.x_tagndx.u32 = 0;
else
- aux.x_sym.x_tagndx.l = symindx;
+ aux.x_sym.x_tagndx.u32 = symindx;
}
}
memset (&iraux, 0, sizeof iraux);
iraux.x_csect.x_smtyp = XTY_SD;
iraux.x_csect.x_smclas = XMC_TC0;
- iraux.x_csect.x_scnlen.l = 0;
+ iraux.x_csect.x_scnlen.u64 = 0;
bfd_coff_swap_aux_out (output_bfd, &iraux, T_NULL, C_HIDEXT, 0, 1,
flinfo->outsyms + bfd_coff_symesz (output_bfd));
whether the output is 32 or 64 bit. */
memset (&iraux, 0, sizeof iraux);
iraux.x_csect.x_smtyp = XTY_SD;
- /* iraux.x_csect.x_scnlen.l = 4 or 8, see below. */
+ /* iraux.x_csect.x_scnlen.u64 = 4 or 8, see below. */
iraux.x_csect.x_smclas = XMC_TC;
/* 32 bit uses a 32 bit R_POS to do the relocations
if (bfd_xcoff_is_xcoff64 (output_bfd))
{
irel->r_size = 63;
- iraux.x_csect.x_scnlen.l = 8;
+ iraux.x_csect.x_scnlen.u64 = 8;
}
else if (bfd_xcoff_is_xcoff32 (output_bfd))
{
irel->r_size = 31;
- iraux.x_csect.x_scnlen.l = 4;
+ iraux.x_csect.x_scnlen.u64 = 4;
}
else
return false;
/* For stub symbols, the section already has its correct size. */
if (h->root.u.def.section->owner == xcoff_hash_table (flinfo->info)->params->stub_bfd)
{
- aux.x_csect.x_scnlen.l = h->root.u.def.section->size;
+ aux.x_csect.x_scnlen.u64 = h->root.u.def.section->size;
}
else if ((h->flags & XCOFF_HAS_SIZE) != 0)
{
{
if (l->h == h)
{
- aux.x_csect.x_scnlen.l = l->size;
+ aux.x_csect.x_scnlen.u64 = l->size;
break;
}
}
isym.n_scnum = h->root.u.c.p->section->output_section->target_index;
isym.n_sclass = C_EXT;
aux.x_csect.x_smtyp = XTY_CM;
- aux.x_csect.x_scnlen.l = h->root.u.c.size;
+ aux.x_csect.x_scnlen.u64 = h->root.u.c.size;
}
else
abort ();
outsym += bfd_coff_symesz (output_bfd);
aux.x_csect.x_smtyp = XTY_LD;
- aux.x_csect.x_scnlen.l = obj_raw_syment_count (output_bfd);
+ aux.x_csect.x_scnlen.u64 = obj_raw_syment_count (output_bfd);
bfd_coff_swap_aux_out (output_bfd, (void *) &aux, T_NULL, C_EXT, 0, 1,
(void *) outsym);
outsym += bfd_coff_auxesz (output_bfd);