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
- /* Skip linkonce sections - we cannot these section symbols as they may disappear. */
- && (sym->bsym->section->flags & (SEC_CODE | SEC_LINK_ONCE)) == SEC_CODE
+ 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. */
+ && (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)
{
memcpy (note + 12, "GA$\ 13a1", 8);
/* Create a relocation to install the start address of the note... */
- create_note_reloc (sec, sym, 20, desc_reloc, 0, note);
+ create_note_reloc (sec, sym, total_size + 20, desc_reloc, 0, note);
/* ...and another one to install the end address. */
- create_note_reloc (sec, sym, desc2_offset, desc_reloc,
- bfd_get_section_size (sym->bsym->section),
+ create_note_reloc (sec, sym, total_size + desc2_offset, desc_reloc,
+ bfd_get_section_size (bsym->section),
note);
total_size += note_size;