/* write.c - emit .o file
- Copyright (C) 1986-2018 Free Software Foundation, Inc.
+ Copyright (C) 1986-2019 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
static fixS *
fix_new_internal (fragS *frag, /* Which frag? */
- int where, /* Where in that frag? */
- int size, /* 1, 2, or 4 usually. */
+ unsigned long where, /* Where in that frag? */
+ unsigned long size, /* 1, 2, or 4 usually. */
symbolS *add_symbol, /* X_add_symbol. */
symbolS *sub_symbol, /* X_op_symbol. */
offsetT offset, /* X_add_number. */
/* We've made fx_size a narrow field; check that it's wide enough. */
if (fixP->fx_size != size)
{
- as_bad (_("field fx_size too small to hold %d"), size);
+ as_bad (_("field fx_size too small to hold %lu"), size);
abort ();
}
fixP->fx_addsy = add_symbol;
fixP->fx_dot_frag = dot_frag;
fixP->fx_pcrel = pcrel;
fixP->fx_r_type = r_type;
- fixP->fx_im_disp = 0;
fixP->fx_pcrel_adjust = 0;
- fixP->fx_bit_fixP = 0;
fixP->fx_addnumber = 0;
fixP->fx_tcbit = 0;
fixP->fx_tcbit2 = 0;
/* Create a fixup relative to a symbol (plus a constant). */
fixS *
-fix_new (fragS *frag, /* Which frag? */
- int where, /* Where in that frag? */
- int size, /* 1, 2, or 4 usually. */
- symbolS *add_symbol, /* X_add_symbol. */
+fix_new (fragS *frag, /* Which frag? */
+ unsigned long where, /* Where in that frag? */
+ unsigned long size, /* 1, 2, or 4 usually. */
+ symbolS *add_symbol, /* X_add_symbol. */
offsetT offset, /* X_add_number. */
int pcrel, /* TRUE if PC-relative relocation. */
RELOC_ENUM r_type /* Relocation type. */)
fixS *
fix_new_exp (fragS *frag, /* Which frag? */
- int where, /* Where in that frag? */
- int size, /* 1, 2, or 4 usually. */
+ unsigned long where, /* Where in that frag? */
+ unsigned long size, /* 1, 2, or 4 usually. */
expressionS *exp, /* Expression. */
int pcrel, /* TRUE if PC-relative relocation. */
RELOC_ENUM r_type /* Relocation type. */)
as for fix_new, except that WHERE is implicitly 0. */
fixS *
-fix_at_start (fragS *frag, int size, symbolS *add_symbol,
+fix_at_start (fragS *frag, unsigned long size, symbolS *add_symbol,
offsetT offset, int pcrel, RELOC_ENUM r_type)
{
return fix_new_internal (frag, 0, size, add_symbol,
md_convert_frag (stdoutput, sec, fragP);
gas_assert (fragP->fr_next == NULL
- || ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
- == fragP->fr_fix));
+ || (fragP->fr_next->fr_address - fragP->fr_address
+ == fragP->fr_fix));
/* After md_convert_frag, we make the frag into a ".space 0".
md_convert_frag() should set up any fixSs and constants
symbol_mark_used_in_reloc (fixP->fx_subsy);
}
- if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && fixP->fx_size != 0)
+ if (!fixP->fx_no_overflow && fixP->fx_size != 0)
{
if (fixP->fx_size < sizeof (valueT))
{
(long) add_number,
(long) (fragP->fr_address + fixP->fx_where));
#endif
- } /* Not a bit fix. */
+ }
#ifdef TC_VALIDATE_FIX
skip: ATTRIBUTE_UNUSED_LABEL
for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
{
int fx_size, slack;
- offsetT loc;
+ valueT loc;
arelent **reloc;
#ifndef RELOC_EXPANSION_POSSIBLE
arelent *rel;
size_seg (stdoutput, s, NULL);
}
-#include "struc-symbol.h"
-
/* Create a relocation against an entry in a GNU Build attribute section. */
static void
/* We create a .b type reloc as resolve_reloc_expr_symbols() has already been called. */
reloc->u.b.sec = sec;
- reloc->u.b.s = sym->bsym;
+ reloc->u.b.s = symbol_get_bfdsym (sym);
reloc->u.b.r.sym_ptr_ptr = & reloc->u.b.s;
reloc->u.b.r.address = offset;
reloc->u.b.r.addend = addend;
offsetT desc2_offset;
int desc_reloc;
symbolS * sym;
+ asymbol * bsym;
if (! flag_generate_build_notes
|| bfd_get_section_by_name (stdoutput,
total_size = 0;
note = NULL;
- for (sym = symbol_rootP; sym != NULL; sym = sym->sy_next)
- if (sym->bsym != NULL
- && sym->bsym->flags & BSF_SECTION_SYM
- && sym->bsym->section != NULL
+ for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym))
+ if ((bsym = symbol_get_bfdsym (sym)) != NULL
+ && bsym->flags & BSF_SECTION_SYM
+ && bsym->section != NULL
/* Skip linkonce sections - we cannot use these section symbols as they may disappear. */
- && (sym->bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE
+ && (bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE
/* Not all linkonce sections are flagged... */
&& strncmp (S_GET_NAME (sym), ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) != 0)
{
/* ...and another one to install the end address. */
create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc,
- bfd_get_section_size (sym->bsym->section),
+ bfd_get_section_size (bsym->section),
note);
total_size += note_size;
fprintf (stderr, " pcrel");
if (fixp->fx_pcrel_adjust)
fprintf (stderr, " pcrel_adjust=%d", fixp->fx_pcrel_adjust);
- if (fixp->fx_im_disp)
- {
-#ifdef TC_NS32K
- fprintf (stderr, " im_disp=%d", fixp->fx_im_disp);
-#else
- fprintf (stderr, " im_disp");
-#endif
- }
if (fixp->fx_tcbit)
fprintf (stderr, " tcbit");
if (fixp->fx_done)