+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * bfd-in.h (bfd_get_section_name, bfd_get_section_vma),
+ (bfd_get_section_lma, bfd_get_section_alignment),
+ (bfd_get_section_size, bfd_get_section_flags),
+ (bfd_get_section_userdata): Delete.
+ (bfd_section_name, bfd_section_size, bfd_section_vma),
+ (bfd_section_lma, bfd_section_alignment): Lose bfd parameter.
+ (bfd_section_flags, bfd_section_userdata): New.
+ (bfd_is_com_section): Rename parameter.
+ * section.c (bfd_set_section_userdata, bfd_set_section_vma),
+ (bfd_set_section_alignment, bfd_set_section_flags, bfd_rename_section),
+ (bfd_set_section_size): Delete bfd parameter, rename section parameter.
+ (bfd_set_section_lma): New.
+ * bfd-in2.h: Regenerate.
+ * mach-o.c (bfd_mach_o_init_section_from_mach_o): Delete bfd param,
+ update callers.
+ * aoutx.h, * bfd.c, * coff-alpha.c, * coff-arm.c, * coff-mips.c,
+ * coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
+ * compress.c, * ecoff.c, * elf-eh-frame.c, * elf-hppa.h,
+ * elf-ifunc.c, * elf-m10200.c, * elf-m10300.c, * elf-properties.c,
+ * elf-s390-common.c, * elf-vxworks.c, * elf.c, * elf32-arc.c,
+ * elf32-arm.c, * elf32-avr.c, * elf32-bfin.c, * elf32-cr16.c,
+ * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, * elf32-csky.c,
+ * elf32-d10v.c, * elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c,
+ * elf32-ft32.c, * elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c,
+ * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, * elf32-m32c.c,
+ * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-mcore.c,
+ * elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c,
+ * elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
+ * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-pru.c,
+ * elf32-rl78.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c,
+ * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
+ * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, * elf32-visium.c,
+ * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
+ * elf64-bpf.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c,
+ * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
+ * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfnn-riscv.c,
+ * elfxx-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c,
+ * elfxx-tilegx.c, * elfxx-x86.c, * i386msdos.c, * linker.c,
+ * mach-o.c, * mmo.c, * opncls.c, * pdp11.c, * pei-x86_64.c,
+ * peicode.h, * reloc.c, * section.c, * syms.c, * vms-alpha.c,
+ * xcofflink.c: Update throughout for bfd section macro and function
+ changes.
+
2019-09-18 Alan Modra <amodra@gmail.com>
* bfd-in.h (bfd_asymbol_section): Rename from bfd_get_section.
break;
case N_TEXT | N_EXT:
section = obj_textsec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_DATA | N_EXT:
case N_SETV | N_EXT:
/* Treat N_SETV symbols as N_DATA symbol; see comment in
translate_from_native_sym_flags. */
section = obj_datasec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_BSS | N_EXT:
section = obj_bsssec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_INDR | N_EXT:
/* An indirect symbol. The next symbol is the symbol
case N_SETT: case N_SETT | N_EXT:
section = obj_textsec (abfd);
flags |= BSF_CONSTRUCTOR;
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_SETD: case N_SETD | N_EXT:
section = obj_datasec (abfd);
flags |= BSF_CONSTRUCTOR;
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_SETB: case N_SETB | N_EXT:
section = obj_bsssec (abfd);
flags |= BSF_CONSTRUCTOR;
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_WARNING:
/* A warning symbol. The next symbol is the one to warn
break;
case N_WEAKT:
section = obj_textsec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
flags = BSF_WEAK;
break;
case N_WEAKD:
section = obj_datasec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
flags = BSF_WEAK;
break;
case N_WEAKB:
section = obj_bsssec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
flags = BSF_WEAK;
break;
}
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL,
(p->type == bfd_section_reloc_link_order
- ? bfd_section_name (flaginfo->output_bfd,
- pr->u.section)
+ ? bfd_section_name (pr->u.section)
: pr->u.name),
howto->name, pr->addend, NULL, NULL, (bfd_vma) 0);
break;
asection *s;
s = aout_reloc_index_to_section (input_bfd, r_index);
- name = bfd_section_name (input_bfd, s);
+ name = bfd_section_name (s);
}
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name, howto->name,
asection *s;
s = aout_reloc_index_to_section (input_bfd, r_index);
- name = bfd_section_name (input_bfd, s);
+ name = bfd_section_name (s);
}
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name,
return FALSE;
PUT_WORD (output_bfd, strtab_index, outsym->e_strx);
PUT_WORD (output_bfd,
- (bfd_get_section_vma (output_bfd,
- obj_textsec (input_bfd)->output_section)
+ (bfd_section_vma (obj_textsec (input_bfd)->output_section)
+ obj_textsec (input_bfd)->output_offset),
outsym->e_value);
++obj_aout_external_sym_count (output_bfd);
BFD_ASSERT (bfd_is_abs_section (output_section)
|| output_section->owner == output_bfd);
val = (hresolve->root.u.def.value
- + bfd_get_section_vma (output_bfd, output_section)
+ + bfd_section_vma (output_section)
+ input_section->output_offset);
/* Get the correct type based on the section. If
? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
: ~ (bfd_vma) 0)
-#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
-#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
-#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
-#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
- (ptr)->alignment_power)
-#define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) ((ptr)->size)
-#define bfd_get_section_size(ptr) ((ptr)->size)
-#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
-#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
-#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
-#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
-#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
-
-#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+#define bfd_section_name(sec) ((sec)->name)
+#define bfd_section_size(sec) ((sec)->size)
+#define bfd_section_vma(sec) ((sec)->vma)
+#define bfd_section_lma(sec) ((sec)->lma)
+#define bfd_section_alignment(sec) ((sec)->alignment_power)
+#define bfd_section_flags(sec) ((sec)->flags)
+#define bfd_section_userdata(sec) ((sec)->userdata)
+
+#define bfd_is_com_section(sec) (((sec)->flags & SEC_IS_COMMON) != 0)
#define bfd_get_section_limit_octets(bfd, sec) \
((bfd)->direction != write_direction && (sec)->rawsize != 0 \
? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \
: ~ (bfd_vma) 0)
-#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
-#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
-#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
-#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \
- (ptr)->alignment_power)
-#define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) ((ptr)->size)
-#define bfd_get_section_size(ptr) ((ptr)->size)
-#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
-#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
-#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
-#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
-#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
-
-#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+#define bfd_section_name(sec) ((sec)->name)
+#define bfd_section_size(sec) ((sec)->size)
+#define bfd_section_vma(sec) ((sec)->vma)
+#define bfd_section_lma(sec) ((sec)->lma)
+#define bfd_section_alignment(sec) ((sec)->alignment_power)
+#define bfd_section_flags(sec) ((sec)->flags)
+#define bfd_section_userdata(sec) ((sec)->userdata)
+
+#define bfd_is_com_section(sec) (((sec)->flags & SEC_IS_COMMON) != 0)
#define bfd_get_section_limit_octets(bfd, sec) \
((bfd)->direction != write_direction && (sec)->rawsize != 0 \
would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
compilers will complain about comma expressions that have no effect. */
static inline bfd_boolean
-bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
- void * val)
+bfd_set_section_userdata (asection *sec, void *val)
+{
+ sec->userdata = val;
+ return TRUE;
+}
+
+static inline bfd_boolean
+bfd_set_section_vma (asection *sec, bfd_vma val)
{
- ptr->userdata = val;
+ sec->vma = sec->lma = val;
+ sec->user_set_vma = TRUE;
return TRUE;
}
static inline bfd_boolean
-bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+bfd_set_section_lma (asection *sec, bfd_vma val)
{
- ptr->vma = ptr->lma = val;
- ptr->user_set_vma = TRUE;
+ sec->lma = val;
return TRUE;
}
static inline bfd_boolean
-bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
- unsigned int val)
+bfd_set_section_alignment (asection *sec, unsigned int val)
{
- ptr->alignment_power = val;
+ sec->alignment_power = val;
return TRUE;
}
asection *bfd_make_section (bfd *, const char *name);
-bfd_boolean bfd_set_section_flags
- (bfd *abfd, asection *sec, flagword flags);
+bfd_boolean bfd_set_section_flags (asection *sec, flagword flags);
void bfd_rename_section
- (bfd *abfd, asection *sec, const char *newname);
+ (asection *sec, const char *newname);
void bfd_map_over_sections
(bfd *abfd,
bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
void *obj);
-bfd_boolean bfd_set_section_size
- (bfd *abfd, asection *sec, bfd_size_type val);
+bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val);
bfd_boolean bfd_set_section_contents
(bfd *abfd, asection *section, const void *data,
bfd_put_32 (abfd, 1 << sec->alignment_power,
&echdr->ch_addralign);
/* bfd_log2 (alignof (Elf32_Chdr)) */
- bfd_set_section_alignment (abfd, sec, 2);
+ bfd_set_section_alignment (sec, 2);
}
else
{
bfd_put_64 (abfd, 1 << sec->alignment_power,
&echdr->ch_addralign);
/* bfd_log2 (alignof (Elf64_Chdr)) */
- bfd_set_section_alignment (abfd, sec, 3);
+ bfd_set_section_alignment (sec, 3);
}
}
else
memcpy (contents, "ZLIB", 4);
bfd_putb64 (sec->size, contents + 4);
/* No way to keep the original alignment, just use 1 always. */
- bfd_set_section_alignment (abfd, sec, 0);
+ bfd_set_section_alignment (sec, 0);
}
}
}
use_memmove = TRUE;
}
- size = bfd_get_section_size (isec) - ihdr_size + ohdr_size;
+ size = bfd_section_size (isec) - ihdr_size + ohdr_size;
if (!use_memmove)
{
contents = (bfd_byte *) bfd_malloc (size);
size = sec->line_filepos * 8;
BFD_ASSERT (size == sec->size
|| size + 8 == sec->size);
- if (! bfd_set_section_size (abfd, sec, size))
+ if (!bfd_set_section_size (sec, size))
return NULL;
}
}
/* Compute a new r_symndx value. */
hsec = h->root.u.def.section;
- name = bfd_get_section_name (output_bfd, hsec->output_section);
+ name = bfd_section_name (hsec->output_section);
r_symndx = (unsigned long) -1;
switch (name[1])
if (r_extern)
name = sym_hashes[r_symndx]->root.root.string;
else
- name = bfd_section_name (input_bfd,
- symndx_to_section[r_symndx]);
+ name = bfd_section_name (symndx_to_section[r_symndx]);
(*info->callbacks->reloc_overflow)
(info, NULL, name, alpha_howto_table[r_type].name,
(bfd_vma) 0, input_bfd, input_section,
sec = bfd_make_section_with_flags (abfd, ARM2THUMB_GLUE_SECTION_NAME,
flags);
if (sec == NULL
- || ! bfd_set_section_alignment (abfd, sec, 2))
+ || !bfd_set_section_alignment (sec, 2))
return FALSE;
}
flags);
if (sec == NULL
- || ! bfd_set_section_alignment (abfd, sec, 2))
+ || !bfd_set_section_alignment (sec, 2))
return FALSE;
}
/* Compute a new r_symndx value. */
s = h->root.u.def.section;
- name = bfd_get_section_name (output_bfd,
- s->output_section);
+ name = bfd_section_name (s->output_section);
int_rel.r_symndx = -1;
switch (name[1])
if (int_rel.r_extern)
name = NULL;
else
- name = bfd_section_name (input_bfd, s);
+ name = bfd_section_name (s);
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd, input_section,
if (text_sec != NULL)
{
internal_a.o_sntext = text_sec->target_index;
- internal_a.o_algntext = bfd_get_section_alignment (abfd, text_sec);
+ internal_a.o_algntext = bfd_section_alignment (text_sec);
}
else
{
if (data_sec != NULL)
{
internal_a.o_sndata = data_sec->target_index;
- internal_a.o_algndata = bfd_get_section_alignment (abfd, data_sec);
+ internal_a.o_algndata = bfd_section_alignment (data_sec);
}
else
{
for (i = 0; i < table_size; ++i)
{
- const char *secname = bfd_get_section_name (abfd, section);
+ const char *secname = bfd_section_name (section);
if (alignment_table[i].comparison_length == (unsigned int) -1
? strcmp (alignment_table[i].name, secname) == 0
#ifdef RS6000COFF_C
if (bfd_xcoff_text_align_power (abfd) != 0
- && strcmp (bfd_get_section_name (abfd, section), ".text") == 0)
+ && strcmp (bfd_section_name (section), ".text") == 0)
section->alignment_power = bfd_xcoff_text_align_power (abfd);
else if (bfd_xcoff_data_align_power (abfd) != 0
- && strcmp (bfd_get_section_name (abfd, section), ".data") == 0)
+ && strcmp (bfd_section_name (section), ".data") == 0)
section->alignment_power = bfd_xcoff_data_align_power (abfd);
else
{
int i;
for (i = 0; i < XCOFF_DWSECT_NBR_NAMES; i++)
- if (strcmp (bfd_get_section_name (abfd, section),
+ if (strcmp (bfd_section_name (section),
xcoff_dwsect_names[i].name) == 0)
{
section->alignment_power = 0;
incremented in coff_set_section_contents. This is right for
SVR3.2. */
if (strcmp (current->name, _LIB) == 0)
- (void) bfd_set_section_vma (abfd, current, 0);
+ bfd_set_section_vma (current, 0);
#endif
#ifdef ALIGN_SECTIONS_IN_FILE
if (text_sec != NULL)
{
internal_a.o_sntext = text_sec->target_index;
- internal_a.o_algntext = bfd_get_section_alignment (abfd, text_sec);
+ internal_a.o_algntext = bfd_section_alignment (text_sec);
}
else
{
if (data_sec != NULL)
{
internal_a.o_sndata = data_sec->target_index;
- internal_a.o_algndata = bfd_get_section_alignment (abfd, data_sec);
+ internal_a.o_algndata = bfd_section_alignment (data_sec);
}
else
{
PR 17521: file: 078-10659-0.004. */
continue;
else
- cache_ptr->u.offset = (dst.l_addr.l_paddr
- - bfd_section_vma (abfd, asect));
+ cache_ptr->u.offset = dst.l_addr.l_paddr - bfd_section_vma (asect);
cache_ptr++;
}
name = _bfd_coff_internal_syment_name (abfd, syment, buf)
sec = coff_section_from_bfd_index (abfd, syment->n_scnum);
if (sec != NULL && name != NULL
- && (strcmp (bfd_get_section_name (abfd, sec), name) == 0))
+ && (strcmp (bfd_section_name (sec), name) == 0))
return COFF_SYMBOL_PE_SECTION;
}
#endif
break;
}
if (new_name != NULL)
- bfd_rename_section (abfd, return_section, new_name);
+ bfd_rename_section (return_section, new_name);
}
return result;
bfd_vma maxdiff;
/* Look through the C_FILE symbols to find the best one. */
- sec_vma = bfd_get_section_vma (abfd, section);
+ sec_vma = bfd_section_vma (section);
*filename_ptr = (char *) p->u.syment._n._n_n._n_offset;
maxdiff = (bfd_vma) 0 - (bfd_vma) 1;
while (1)
if ((flags & SEC_GROUP) != 0)
return FALSE;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
s_comdat = bfd_coff_get_comdat_section (abfd, sec);
if (s_comdat != NULL)
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL,
(link_order->type == bfd_section_reloc_link_order
- ? bfd_section_name (output_bfd,
- link_order->u.reloc.p->u.section)
+ ? bfd_section_name (link_order->u.reloc.p->u.section)
: link_order->u.reloc.p->u.name),
howto->name, link_order->u.reloc.p->addend,
(bfd *) NULL, (asection *) NULL, (bfd_vma) 0);
return 0;
}
free (uncompressed_buffer);
- bfd_set_section_alignment (abfd, sec,
- orig_uncompressed_alignment_pow);
+ bfd_set_section_alignment (sec, orig_uncompressed_alignment_pow);
sec->contents = buffer;
sec->compress_status = COMPRESS_SECTION_DONE;
&& filesize < sz
/* PR 24753: Linker created sections can be larger than
the file size, eg if they are being used to hold stubs. */
- && (bfd_get_section_flags (abfd, sec) & SEC_LINKER_CREATED) == 0
+ && (bfd_section_flags (sec) & SEC_LINKER_CREATED) == 0
/* The MMO file format supports its own special compression
technique, but it uses COMPRESS_SECTION_NONE when loading
a section's contents. */
sec->compressed_size = sec->size;
sec->size = uncompressed_size;
- bfd_set_section_alignment (abfd, sec, uncompressed_alignment_power);
+ bfd_set_section_alignment (sec, uncompressed_alignment_power);
sec->compress_status = DECOMPRESS_SECTION_SIZED;
return TRUE;
abort ();
rptr->sym_ptr_ptr = sec->symbol_ptr_ptr;
- rptr->addend = - bfd_get_section_vma (abfd, sec);
+ rptr->addend = - bfd_section_vma (sec);
}
- rptr->address = intern.r_vaddr - bfd_get_section_vma (abfd, section);
+ rptr->address = intern.r_vaddr - bfd_section_vma (section);
/* Let the backend select the howto field and do any other
required processing. */
strncpy (section.s_name, current->name, sizeof section.s_name);
/* This seems to be correct for Irix 4 shared libraries. */
- vma = bfd_get_section_vma (abfd, current);
+ vma = bfd_section_vma (current);
if (streq (current->name, _LIB))
section.s_vaddr = 0;
else
if (reloc->howto == NULL)
continue;
- in.r_vaddr = (reloc->address
- + bfd_get_section_vma (abfd, current));
+ in.r_vaddr = reloc->address + bfd_section_vma (current);
in.r_type = reloc->howto->type;
if ((sym->flags & BSF_SECTION_SYM) == 0)
{ _RCONST, RELOC_SECTION_RCONST }
};
- name = bfd_get_section_name (abfd, bfd_asymbol_section (sym));
+ name = bfd_section_name (bfd_asymbol_section (sym));
for (j = 0; j < ARRAY_SIZE (section_symndx); j++)
if (streq (name, section_symndx[j].name))
(*info->callbacks->reloc_overflow)
(info, NULL,
(link_order->type == bfd_section_reloc_link_order
- ? bfd_section_name (output_bfd, section)
+ ? bfd_section_name (section)
: link_order->u.reloc.p->u.name),
rel.howto->name, addend, NULL, NULL, (bfd_vma) 0);
break;
rel.addend = 0;
/* Move the information into an internal_reloc structure. */
- in.r_vaddr = (rel.address
- + bfd_get_section_vma (output_bfd, output_section));
+ in.r_vaddr = rel.address + bfd_section_vma (output_section);
in.r_type = rel.howto->type;
if (type == bfd_symbol_reloc_link_order)
{ _RCONST, RELOC_SECTION_RCONST }
};
- name = bfd_get_section_name (output_bfd, section);
+ name = bfd_section_name (section);
for (i = 0; i < ARRAY_SIZE (section_symndx); i++)
if (streq (name, section_symndx[i].name))
};
output_section = h->root.u.def.section->output_section;
- name = bfd_section_name (output_section->owner, output_section);
+ name = bfd_section_name (output_section);
for (i = 0; i < ARRAY_SIZE (section_storage_classes); i++)
if (streq (name, section_storage_classes[i].name))
if (!sec->rawsize)
sec->rawsize = sec->size;
- bfd_set_section_size (sec->owner, sec, sec->size + 8);
+ bfd_set_section_size (sec, sec->size + 8);
}
/* Finish a pass over all .eh_frame_entry sections. */
{
for (o = abfd->sections; o; o = o->next)
{
- const char *name = bfd_get_section_name (abfd, o);
+ const char *name = bfd_section_name (o);
if (strcmp (name, ".eh_frame_entry")
&& !bfd_is_abs_section (o->output_section))
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".PARISC.unwind") == 0)
{
s = bfd_make_section_with_flags (abfd, rel_sec,
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelifunc = s;
}
for static executables. */
s = bfd_make_section_with_flags (abfd, ".iplt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->iplt = s;
? ".rela.iplt" : ".rel.iplt"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelplt = s;
else
s = bfd_make_section_with_flags (abfd, ".igot", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->igotplt = s;
}
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
htab->splt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
htab->sgot = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_plt)
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
htab->sgotplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
flags | SEC_READONLY);
htab->root.srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (! _bfd_mn10300_elf_create_got_section (abfd, info))
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (streq (name, ".plt"))
{
entry. The entries in the .rela.plt section
really apply to the .got section, which we
created ourselves and so know is not readonly. */
- outname = bfd_get_section_name (output_bfd,
- s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 5);
if (target != NULL
&& (target->flags & SEC_READONLY) != 0
align_shift = bed->s->elfclass == ELFCLASS64 ? 3 : 2;
/* Get the output .note.gnu.property section size. */
- size = bfd_get_section_size (isec->output_section);
+ size = bfd_section_size (isec->output_section);
/* Update the output .note.gnu.property section alignment. */
- bfd_set_section_alignment (obfd, isec->output_section, align_shift);
+ bfd_set_section_alignment (isec->output_section, align_shift);
- if (size > bfd_get_section_size (isec))
+ if (size > bfd_section_size (isec))
{
contents = (bfd_byte *) bfd_malloc (size);
free (*ptr);
s = bfd_make_section_with_flags (abfd, ".rela.ifunc",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelifunc = s;
}
s = bfd_make_section_with_flags (abfd, ".iplt",
flags | SEC_CODE | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->iplt = s;
s = bfd_make_section_with_flags (abfd, ".rela.iplt", flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelplt = s;
s = bfd_make_section_with_flags (abfd, ".igot.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->igotplt = s;
| SEC_READONLY
| SEC_LINKER_CREATED);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
*srelplt2_out = s;
case DT_VX_WRS_TLS_DATA_ALIGN:
sec = bfd_get_section_by_name (output_bfd, ".tls_data");
- dyn->d_un.d_val
- = (bfd_size_type)1 << bfd_get_section_alignment (output_bfd,
- sec);
+ dyn->d_un.d_val = (bfd_size_type) 1 << bfd_section_alignment (sec);
break;
case DT_VX_WRS_TLS_VARS_START:
if (name == NULL)
name = "(null)";
else if (sym_sec && *name == '\0')
- name = bfd_section_name (abfd, sym_sec);
+ name = bfd_section_name (sym_sec);
return name;
}
newsect->filepos = hdr->sh_offset;
- if (! bfd_set_section_vma (abfd, newsect, hdr->sh_addr)
- || ! bfd_set_section_size (abfd, newsect, hdr->sh_size)
- || ! bfd_set_section_alignment (abfd, newsect,
- bfd_log2 (hdr->sh_addralign)))
+ if (!bfd_set_section_vma (newsect, hdr->sh_addr)
+ || !bfd_set_section_size (newsect, hdr->sh_size)
+ || !bfd_set_section_alignment (newsect, bfd_log2 (hdr->sh_addralign)))
return FALSE;
flags = SEC_NO_FLAGS;
if (! bed->elf_backend_section_flags (&flags, hdr))
return FALSE;
- if (! bfd_set_section_flags (abfd, newsect, flags))
+ if (!bfd_set_section_flags (newsect, flags))
return FALSE;
/* We do not parse the PT_NOTE segments as we are interested even in the
char *new_name = convert_zdebug_to_debug (abfd, name);
if (new_name == NULL)
return FALSE;
- bfd_rename_section (abfd, newsect, new_name);
+ bfd_rename_section (newsect, new_name);
}
}
else
{
unsigned int secalign;
- secalign = bfd_get_section_alignment (abfd, *secpp);
+ secalign = bfd_section_alignment (*secpp);
if (secalign > align_power)
align_power = secalign;
}
sec = *secpp;
this_hdr = &elf_section_data (sec)->this_hdr;
- align = (bfd_size_type) 1 << bfd_get_section_alignment (abfd, sec);
+ align = (bfd_size_type) 1 << bfd_section_alignment (sec);
if ((p->p_type == PT_LOAD
|| p->p_type == PT_TLS)
|| (segment->p_paddr \
? segment->p_paddr != section->lma \
: segment->p_vaddr != section->vma) \
- || (strcmp (bfd_get_section_name (ibfd, section), ".dynamic") \
- == 0)) \
+ || (strcmp (bfd_section_name (section), ".dynamic") == 0)) \
&& (segment->p_type != PT_LOAD || !section->segment_mark))
/* If the output section of a section in the input segment is NULL,
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
{
- if ((bfd_get_section_flags (ibfd, sec)
+ if ((bfd_section_flags (sec)
& (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
== (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
only_data_sections = FALSE;
htab->srofixup = bfd_make_section_with_flags (dynobj, ".rofixup",
(SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY));
- if (htab->srofixup == NULL || ! bfd_set_section_alignment (dynobj, htab->srofixup, 2))
+ if (htab->srofixup == NULL
+ || !bfd_set_section_alignment (htab->srofixup, 2))
return FALSE;
}
s = bfd_make_section_anyway_with_flags (dynobj, ".iplt",
flags | SEC_READONLY | SEC_CODE);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->root.iplt = s;
}
RELOC_SECTION (htab, ".iplt"),
flags | SEC_READONLY);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->root.irelplt = s;
}
{
s = bfd_make_section_anyway_with_flags (dynobj, ".igot.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (dynobj, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->root.igotplt = s;
}
sec = bfd_make_section_anyway_with_flags (abfd, name, ARM_GLUE_SECTION_FLAGS);
if (sec == NULL
- || !bfd_set_section_alignment (abfd, sec, 2))
+ || !bfd_set_section_alignment (sec, 2))
return FALSE;
/* Set the gc mark to prevent the section from being removed by garbage
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r_symndx != STN_UNDEF
if (!exidx_sec->rawsize)
exidx_sec->rawsize = exidx_sec->size;
- bfd_set_section_size (exidx_sec->owner, exidx_sec, exidx_sec->size + adjust);
+ bfd_set_section_size (exidx_sec, exidx_sec->size + adjust);
out_sec = exidx_sec->output_section;
/* Adjust size of output section. */
- bfd_set_section_size (out_sec->owner, out_sec, out_sec->size +adjust);
+ bfd_set_section_size (out_sec, out_sec->size +adjust);
}
/* Insert an EXIDX_CANTUNWIND marker at the end of a section. */
{
flagword flags;
- flags = bfd_get_section_flags (dynobj, sreloc);
+ flags = bfd_section_flags (sreloc);
flags &= ~(SEC_LOAD | SEC_ALLOC);
- bfd_set_section_flags (dynobj, sreloc, flags);
+ bfd_set_section_flags (sreloc, flags);
}
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (s == htab->root.splt)
{
{
const char * name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (is_arm_elf_unwind_section_name (abfd, name))
{
if (strcmp (sec->name, ".glue_7")
&& strcmp (sec->name, ".glue_7t"))
{
- if ((bfd_get_section_flags (ibfd, sec)
+ if ((bfd_section_flags (sec)
& (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
== (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
only_data_sections = FALSE;
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
return (a->offset - b->offset);
if (a->section != b->section)
- return (bfd_get_section_vma (a->section->owner, a->section)
- - bfd_get_section_vma (b->section->owner, b->section));
+ return bfd_section_vma (a->section) - bfd_section_vma (b->section);
return (a->type - b->type);
}
/* Return true if ADDRESS is within the vma range of SECTION from ABFD. */
static bfd_boolean
-avr_is_section_for_address (bfd *abfd, asection *section, bfd_vma address)
+avr_is_section_for_address (asection *section, bfd_vma address)
{
bfd_vma vma;
bfd_size_type size;
- vma = bfd_get_section_vma (abfd, section);
+ vma = bfd_section_vma (section);
if (address < vma)
return FALSE;
perform any checks, and just returns. */
static void
-avr_find_section_for_address (bfd *abfd,
+avr_find_section_for_address (bfd *abfd ATTRIBUTE_UNUSED,
asection *section, void *data)
{
struct avr_find_section_data *fs_data
return;
/* If this section isn't part of the addressable code content, skip it. */
- if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0
- && (bfd_get_section_flags (abfd, section) & SEC_CODE) == 0)
+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0
+ && (bfd_section_flags (section) & SEC_CODE) == 0)
return;
- if (avr_is_section_for_address (abfd, section, fs_data->address))
+ if (avr_is_section_for_address (section, fs_data->address))
fs_data->section = section;
}
fs_data.section = NULL;
- size = bfd_get_section_size (sec);
+ size = bfd_section_size (sec);
contents = bfd_malloc (size);
bfd_get_section_contents (abfd, sec, contents, 0, size);
ptr = contents;
{
/* Try to find section and offset from address. */
if (fs_data.section != NULL
- && !avr_is_section_for_address (abfd, fs_data.section,
- address))
+ && !avr_is_section_for_address (fs_data.section, address))
fs_data.section = NULL;
if (fs_data.section == NULL)
r_list->records [i].section = fs_data.section;
r_list->records [i].offset
- = address - bfd_get_section_vma (abfd, fs_data.section);
+ = address - bfd_section_vma (fs_data.section);
}
r_list->records [i].type = *((bfd_byte *) ptr);
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
bfd_vma offset;
addend += bfinfdpic_got_section (info)->output_section->vma;
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_bfinfdpic_osec_readonly_p (output_bfd,
picrel);
}
}
- else if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ else if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
if (osec)
addend += osec->output_section->vma;
if (IS_FDPIC (input_bfd)
- && (bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ && (bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_bfinfdpic_osec_readonly_p (output_bfd,
}
else
{
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_bfinfdpic_osec_readonly_p (output_bfd,
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
elf_hash_table (info)->sgot = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_sym)
s = bfd_make_section_anyway_with_flags (abfd, ".rel.got",
(flags | SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
bfinfdpic_gotrel_section (info) = s;
s = bfd_make_section_anyway_with_flags (abfd, ".rofixup",
(flags | SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
bfinfdpic_gotfixup_section (info) = s;
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
/* Blackfin-specific: remember it. */
bfinfdpic_plt_section (info) = s;
s = bfd_make_section_anyway_with_flags (abfd, ".rel.plt",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
/* Blackfin-specific: remember it. */
bfinfdpic_pltrel_section (info) = s;
".rela.bss",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
}
}
case R_BFIN_FUNCDESC_VALUE:
picrel->relocsfdv++;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32--;
/* Fall through. */
break;
picrel->sym++;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32++;
break;
/* Apply the required alignment. */
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
- if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ if (power_of_two > bfd_section_alignment (s))
{
- if (!bfd_set_section_alignment (dynobj, s, power_of_two))
+ if (!bfd_set_section_alignment (s, power_of_two))
return FALSE;
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
strip = FALSE;
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
htab->sgot= s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_plt)
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
htab->sgotplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
flags | SEC_READONLY);
htab->srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (! _bfd_cr16_elf_create_got_section (abfd, info))
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strcmp (name, ".plt") == 0)
{
entry. The entries in the .rela.plt section
really apply to the .got section, which we
created ourselves and so know is not readonly. */
- outname = bfd_get_section_name (output_bfd,
- s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 5);
if (target != NULL
&& (target->flags & SEC_READONLY) != 0
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".fcommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".fcommon") == 0)
*retval = SHN_CR16C_FCOMMON;
- else if (strcmp (bfd_get_section_name (abfd, sec), ".ncommon") == 0)
+ else if (strcmp (bfd_section_name (sec), ".ncommon") == 0)
*retval = SHN_CR16C_NCOMMON;
else
return FALSE;
symname = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (symname == NULL)
- symname = bfd_section_name (input_bfd, sec);
+ symname = bfd_section_name (sec);
}
else
{
if ((got = bfd_get_section_by_name (abfd, ".got")) == NULL)
return (bfd_vma) -1;
- plt_sec_size = bfd_section_size (plt->owner, plt);
+ plt_sec_size = bfd_section_size (plt);
plt_entry_size
= (bfd_get_mach (abfd) == bfd_mach_cris_v32
? PLT_ENTRY_SIZE_V32 : PLT_ENTRY_SIZE);
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strcmp (name, ".plt") == 0)
{
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
if (htab->elf.hplt != NULL)
strip_section = FALSE;
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rel") )
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rel") )
{
if (s->size != 0 )
relocs = TRUE;
if (name == NULL)
break;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
(*info->callbacks->reloc_overflow)
(info,
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
r = _bfd_final_link_relocate (howto, input_bfd, input_section,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
if (name == NULL || name[0] == 0)
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
else
{
&& (!h || FRVFDPIC_FUNCDESC_LOCAL (info, h)))
{
addend += frvfdpic_got_section (info)->output_section->vma;
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
picrel);
}
}
- else if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ else if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
if (osec)
addend += osec->output_section->vma;
if (IS_FDPIC (input_bfd)
- && (bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ && (bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_frvfdpic_osec_readonly_p (output_bfd,
}
else
{
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
bfd_vma offset;
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
elf_hash_table (info)->sgot = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (bed->want_got_sym)
(flags | SEC_READONLY));
elf_hash_table (info)->srelgot = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
/* Machine-specific. */
s = bfd_make_section_anyway_with_flags (abfd, ".rofixup",
(flags | SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
frvfdpic_gotfixup_section (info) = s;
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
/* FRV-specific: remember it. */
frvfdpic_plt_section (info) = s;
s = bfd_make_section_anyway_with_flags (abfd, ".rel.plt",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
/* FRV-specific: remember it. */
frvfdpic_pltrel_section (info) = s;
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
}
}
case R_FRV_FUNCDESC_VALUE:
picrel->relocsfdv++;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32--;
/* Fall through. */
break;
picrel->sym = 1;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
picrel->relocs32++;
break;
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
/* Make space for the plt stub at the end of the .plt
section. We want this stub right at the end, up
against the .got section. */
- int gotalign = bfd_section_alignment (dynobj, htab->etab.sgot);
- int pltalign = bfd_section_alignment (dynobj, sec);
+ int gotalign = bfd_section_alignment (htab->etab.sgot);
+ int pltalign = bfd_section_alignment (sec);
bfd_size_type mask;
if (gotalign > pltalign)
- (void) bfd_set_section_alignment (dynobj, sec, gotalign);
+ bfd_set_section_alignment (sec, gotalign);
mask = ((bfd_size_type) 1 << gotalign) - 1;
sec->size = (sec->size + sizeof (plt_stub) + mask) & ~mask;
}
|| sec == htab->etab.sdynbss
|| sec == htab->etab.sdynrelro)
;
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, sec), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (sec), ".rela"))
{
if (sec->size != 0)
{
if (sym_name == NULL)
return FALSE;
if (*sym_name == '\0')
- sym_name = bfd_section_name (input_bfd, sym_sec);
+ sym_name = bfd_section_name (sym_sec);
_bfd_error_handler
(_("%pB:%s has both normal and TLS relocs"),
input_bfd, sym_name);
if (sym_name == NULL)
return FALSE;
if (*sym_name == '\0')
- sym_name = bfd_section_name (input_bfd, sym_sec);
+ sym_name = bfd_section_name (sym_sec);
}
howto = elf_hppa_howto_table + r_type;
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
/* This is an ugly, but unfortunately necessary hack that is
needed when producing EFI binaries on x86. It tells
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, osec) : name;
+ name = name == NULL ? bfd_section_name (osec) : name;
}
else
{
| SEC_LINKER_CREATED
| SEC_READONLY));
if (lm32fdpic_fixup32_section (info) == NULL
- || ! bfd_set_section_alignment (dynobj,
- lm32fdpic_fixup32_section (info), 2))
+ || !bfd_set_section_alignment (lm32fdpic_fixup32_section (info), 2))
return FALSE;
return TRUE;
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
if ((!h) || (h && h->root.type != bfd_link_hash_undefweak))
{
/* Only create .rofixup entries for relocs in loadable sections. */
- if ((bfd_get_section_flags (output_bfd, input_section->output_section)
+ if ((bfd_section_flags (input_section->output_section)
& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->root.srelplt)
relocs = TRUE;
/* Don't generate entries for weak symbols. */
if (!h || (h && h->root.type != bfd_link_hash_undefweak))
{
- if (!discarded_section (s) && !((bfd_get_section_flags (ibfd, s) & SEC_ALLOC) == 0))
+ if (!discarded_section (s) && !((bfd_section_flags (s) & SEC_ALLOC) == 0))
{
switch (ELF32_R_TYPE (internal_relocs->r_info))
{
if (!strcmp (current->name, h->root.root.string))
break;
}
- if (!current && !discarded_section (s) && (bfd_get_section_flags (ibfd, s) & SEC_ALLOC))
+ if (!current && !discarded_section (s) && (bfd_section_flags (s) & SEC_ALLOC))
{
/* Will this have an entry in the GOT. */
if (ELF32_R_TYPE (internal_relocs->r_info) == R_LM32_16_GOT)
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
htab->root.splt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
if (bed->want_plt_sym)
flags | SEC_READONLY);
htab->root.srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (htab->root.sgot == NULL
flags | SEC_READONLY);
htab->srelbss = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (sym->st_name == 0) ? bfd_section_name (input_bfd, sec) : name;
+ name = sym->st_name == 0 ? bfd_section_name (sec) : name;
}
else
{
flags);
elf_hash_table (info)->splt = splt;
if (splt == NULL
- || ! bfd_set_section_alignment (dynobj, splt, 1))
+ || !bfd_set_section_alignment (splt, 1))
return FALSE;
}
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".scommon") == 0)
{
*retval = SHN_M32R_SCOMMON;
return TRUE;
flags);
if (s == NULL)
return FALSE;
- if (! bfd_set_section_alignment (abfd, s, 2))
+ if (!bfd_set_section_alignment (s, 2))
return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
htab->root.splt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
if (bed->want_plt_sym)
flags | SEC_READONLY);
htab->root.srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (htab->root.sgot == NULL
flags | SEC_READONLY);
htab->srelbss = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->root.srelplt)
relocs = TRUE;
const char *name;
BFD_ASSERT (sec != NULL);
- name = bfd_get_section_name (sec->owner, sec);
+ name = bfd_section_name (sec);
if ( strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (errmsg != NULL)
section != NULL;
section = section->next)
{
- const char* name = bfd_get_section_name (input_bfd, section);
+ const char *name = bfd_section_name (section);
if (!strcmp (name, ".tramp"))
htab->tramp_section = section;
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (is_far && ELF32_R_TYPE (rel->r_info) == R_M68HC11_16)
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strcmp (name, ".plt") == 0)
{
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
_bfd_error_handler
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
break;
if (* name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
(*info->callbacks->reloc_overflow)
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->etab.srelplt)
relocs = TRUE;
/* Only relocate if the symbol is defined. */
if (sec)
{
- name = bfd_get_section_name (sec->owner, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".sdata2") == 0
|| strcmp (name, ".sbss2") == 0)
/* Only relocate if the symbol is defined. */
if (sec)
{
- name = bfd_get_section_name (sec->owner, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0)
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (errmsg != NULL)
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
if (power_of_two > s->alignment_power)
{
- if (!bfd_set_section_alignment (s->owner, s, power_of_two))
+ if (!bfd_set_section_alignment (s, power_of_two))
return FALSE;
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strncmp (name, ".rela", 5) == 0)
{
put into .sbss. */
*secp = bfd_make_section_old_way (abfd, ".sbss");
if (*secp == NULL
- || ! bfd_set_section_flags (abfd, *secp, SEC_IS_COMMON))
+ || !bfd_set_section_flags (*secp, SEC_IS_COMMON))
return FALSE;
*valp = sym->st_size;
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL || * name == 0) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL || *name == 0 ? bfd_section_name (sec) : name;
}
else
{
name = bfd_elf_string_from_elf_section
(abfd, symtab_hdr->sh_link, isym->st_name);
- name = (name == NULL || * name == 0) ? bfd_section_name (abfd, sec) : name;
+ name = name == NULL || *name == 0 ? bfd_section_name (sec) : name;
if (isym->st_shndx != sec_shndx)
continue;
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
/* _bfd_elf_create_got_section will create it for us. */
ehtab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
if (ehtab->srelgot == NULL
- || !bfd_set_section_flags (dynobj, ehtab->srelgot,
+ || !bfd_set_section_flags (ehtab->srelgot,
(SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED
| SEC_READONLY))
- || !bfd_set_section_alignment (dynobj, ehtab->srelgot, 2))
+ || !bfd_set_section_alignment (ehtab->srelgot, 2))
return FALSE;
return TRUE;
s = bfd_make_section (abfd, ".plt");
ehtab->splt = s;
if (s == NULL
- || !bfd_set_section_flags (abfd, s, pltflags)
- || !bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_flags (s, pltflags)
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
if (bed->want_plt_sym)
bed->default_use_rela_p ? ".rela.plt" : ".rel.plt");
ehtab->srelplt = s;
if (s == NULL
- || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_flags (s, flags | SEC_READONLY)
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (ehtab->sgot == NULL && !create_got_section (abfd, info))
for (sec = abfd->sections; sec; sec = sec->next)
{
- secflags = bfd_get_section_flags (abfd, sec);
+ secflags = bfd_section_flags (sec);
if ((secflags & (SEC_DATA | SEC_LINKER_CREATED))
|| ((secflags & SEC_HAS_CONTENTS) != SEC_HAS_CONTENTS))
continue;
- secname = bfd_get_section_name (abfd, sec);
+ secname = bfd_section_name (sec);
relname = (char *) bfd_malloc ((bfd_size_type) strlen (secname) + 6);
strcpy (relname, ".rela");
strcat (relname, secname);
continue;
s = bfd_make_section (abfd, relname);
if (s == NULL
- || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_flags (s, flags | SEC_READONLY)
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
s = bfd_make_section (abfd, ".dynbss");
htab->sdynbss = s;
if (s == NULL
- || !bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED))
+ || !bfd_set_section_flags (s, SEC_ALLOC | SEC_LINKER_CREATED))
return FALSE;
/* The .rel[a].bss section holds copy relocs. This section is not
normally needed. We need to create it here, though, so that the
? ".rela.bss" : ".rel.bss"));
htab->srelbss = s;
if (s == NULL
- || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY)
- || !bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_flags (s, flags | SEC_READONLY)
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
/* Apply the required alignment. */
s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
- if (power_of_two > bfd_get_section_alignment (dynobj, s))
+ if (power_of_two > bfd_section_alignment (s))
{
- if (!bfd_set_section_alignment (dynobj, s, power_of_two))
+ if (!bfd_set_section_alignment (s, power_of_two))
return FALSE;
}
{
got_size += s->size;
}
- else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
+ else if (strncmp (bfd_section_name (s), ".rela", 5) == 0)
{
if (s->size != 0 && s != elf_hash_table (info)->srelplt)
relocs = TRUE;
return FALSE;
BFD_ASSERT (strncmp (name, ".rela", 5) == 0
- && strcmp (bfd_get_section_name (input_bfd,
- input_section),
+ && strcmp (bfd_section_name (input_section),
name + 5) == 0);
sreloc = bfd_get_section_by_name (dynobj, name);
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (errmsg != NULL)
return FALSE;
BFD_ASSERT (strncmp (name, ".rela", 5) == 0
- && strcmp (bfd_get_section_name (abfd, sec),
+ && strcmp (bfd_section_name (sec),
name + 5) == 0);
sreloc = bfd_get_section_by_name (dynobj, name);
if ((sec->flags & SEC_ALLOC) != 0)
flags |= SEC_ALLOC | SEC_LOAD;
if (sreloc == NULL
- || !bfd_set_section_flags (dynobj, sreloc, flags)
- || !bfd_set_section_alignment (dynobj, sreloc, 2))
+ || !bfd_set_section_flags (sreloc, flags)
+ || !bfd_set_section_alignment (sreloc, 2))
return FALSE;
elf_section_type (sreloc) = SHT_RELA;
(input_bfd, symtab_hdr->sh_link,
sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
/* xgettext:c-format */
format = _("unable to reach %s (at %#" PRIx64 ") from "
symtab_hdr->sh_link,
sym->st_name);
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
nios2_elf32_fake_sections (bfd *abfd ATTRIBUTE_UNUSED,
Elf_Internal_Shdr *hdr, asection *sec)
{
- register const char *name = bfd_get_section_name (abfd, sec);
+ const char *name = bfd_section_name (sec);
if ((sec->flags & SEC_SMALL_DATA)
|| strcmp (name, ".sdata") == 0
/* In order for the two loads in .PLTresolve to share the same %hiadj,
_GLOBAL_OFFSET_TABLE_ must be aligned to a 16-byte boundary. */
- if (!bfd_set_section_alignment (dynobj, htab->root.sgotplt, 4))
+ if (!bfd_set_section_alignment (htab->root.sgotplt, 4))
return FALSE;
/* The Nios II ABI specifies that GOT-relative relocations are relative
same %hiadj, the start of the PLT (as well as the GOT) must be aligned
to a 16-byte boundary. This is because the addresses for these loads
include the -(.plt+4) PIC correction. */
- return bfd_set_section_alignment (dynobj, htab->root.splt, 4);
+ return bfd_set_section_alignment (htab->root.splt, 4);
}
/* Implement elf_backend_copy_indirect_symbol:
/* Align dynbss. */
s->size = BFD_ALIGN (s->size, (bfd_size_type)1 << align2);
- if (align2 > bfd_get_section_alignment (dynobj, s)
- && !bfd_set_section_alignment (dynobj, s, align2))
+ if (align2 > bfd_section_alignment (s)
+ && !bfd_set_section_alignment (s, align2))
return FALSE;
/* Define the symbol as being at this point in the section. */
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (CONST_STRNEQ (name, ".rela"))
{
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
return FALSE;
if (strncmp (name, ".rela", 5) != 0
- || strcmp (bfd_get_section_name (abfd, sec),
- name + 5) != 0)
+ || strcmp (bfd_section_name (sec), name + 5) != 0)
{
_bfd_error_handler
/* xgettext:c-format */
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->root.srelplt)
relocs = TRUE;
return FALSE;
newsect = hdr->bfd_section;
- flags = bfd_get_section_flags (abfd, newsect);
+ flags = bfd_section_flags (newsect);
if (hdr->sh_flags & SHF_EXCLUDE)
flags |= SEC_EXCLUDE;
if (hdr->sh_type == SHT_ORDERED)
flags |= SEC_SORT_ENTRIES;
- bfd_set_section_flags (abfd, newsect, flags);
+ bfd_set_section_flags (newsect, flags);
return TRUE;
}
/* Set the output section size, if it exists. */
asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME);
- if (asec && ! bfd_set_section_size (abfd, asec, 20 + num_entries * 4))
+ if (asec && !bfd_set_section_size (asec, 20 + num_entries * 4))
{
ibfd = abfd;
/* xgettext:c-format */
executable. */
flagword flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
- if (!bfd_set_section_flags (abfd, htab->elf.sgot, flags))
+ if (!bfd_set_section_flags (htab->elf.sgot, flags))
return FALSE;
}
if (p2align < htab->params->plt_stub_align)
p2align = htab->params->plt_stub_align;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, p2align))
+ || !bfd_set_section_alignment (s, p2align))
return FALSE;
if (!info->no_ld_generated_unwind_info)
s = bfd_make_section_anyway_with_flags (abfd, ".eh_frame", flags);
htab->glink_eh_frame = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd, ".iplt", flags);
htab->elf.iplt = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 4))
+ || !bfd_set_section_alignment (s, 4))
return FALSE;
flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS
s = bfd_make_section_anyway_with_flags (abfd, ".rela.iplt", flags);
htab->elf.irelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || ! bfd_set_section_alignment (s, 2))
return FALSE;
/* Local plt entries. */
htab->pltlocal = bfd_make_section_anyway_with_flags (abfd, ".branch_lt",
flags);
if (htab->pltlocal == NULL
- || ! bfd_set_section_alignment (abfd, htab->pltlocal, 2))
+ || !bfd_set_section_alignment (htab->pltlocal, 2))
return FALSE;
if (bfd_link_pic (info))
htab->relpltlocal
= bfd_make_section_anyway_with_flags (abfd, ".rela.branch_lt", flags);
if (htab->relpltlocal == NULL
- || ! bfd_set_section_alignment (abfd, htab->relpltlocal, 2))
+ || !bfd_set_section_alignment (htab->relpltlocal, 2))
return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd, ".rela.sbss", flags);
htab->relsbss = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
}
if (htab->plt_type == PLT_VXWORKS)
/* The VxWorks PLT is a loaded section with contents. */
flags |= SEC_HAS_CONTENTS | SEC_LOAD | SEC_READONLY;
- return bfd_set_section_flags (abfd, s, flags);
+ return bfd_set_section_flags (s, flags);
}
/* Copy the extra info we tack onto an elf_link_hash_entry. */
linker_section_ptr->lsect = lsect;
*ptr_linker_section_ptr = linker_section_ptr;
- if (!bfd_set_section_alignment (lsect->section->owner, lsect->section, 2))
+ if (!bfd_set_section_alignment (lsect->section, 2))
return FALSE;
linker_section_ptr->offset = lsect->section->size;
lsect->section->size += 4;
/* The new PLT is a loaded section. */
if (htab->elf.splt != NULL
- && !bfd_set_section_flags (htab->elf.dynobj, htab->elf.splt, flags))
+ && !bfd_set_section_flags (htab->elf.splt, flags))
return -1;
/* The new GOT is not executable. */
if (htab->elf.sgot != NULL
- && !bfd_set_section_flags (htab->elf.dynobj, htab->elf.sgot, flags))
+ && !bfd_set_section_flags (htab->elf.sgot, flags))
return -1;
}
else
{
/* Stop an unused .glink section from affecting .text alignment. */
if (htab->glink != NULL
- && !bfd_set_section_alignment (htab->elf.dynobj, htab->glink, 0))
+ && !bfd_set_section_alignment (htab->glink, 0))
return -1;
}
return htab->plt_type == PLT_NEW;
{
strip_section = (s->flags & SEC_KEEP) == 0;
}
- else if (CONST_STRNEQ (bfd_get_section_name (htab->elf.dynobj, s),
- ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0)
{
unresolved_reloc = TRUE;
break;
}
- BFD_ASSERT (strcmp (bfd_get_section_name (sec->owner, sec),
- ".got") == 0
- || strcmp (bfd_get_section_name (sec->owner, sec),
- ".cgot") == 0);
+ BFD_ASSERT (strcmp (bfd_section_name (sec), ".got") == 0
+ || strcmp (bfd_section_name (sec), ".cgot") == 0);
addend -= sec->output_section->vma + sec->output_offset + 0x8000;
break;
}
addend -= SYM_VAL (sda);
- name = bfd_get_section_name (output_bfd, sec->output_section);
+ name = bfd_section_name (sec->output_section);
if (!(strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0))
{
}
addend -= SYM_VAL (sda);
- name = bfd_get_section_name (output_bfd, sec->output_section);
+ name = bfd_section_name (sec->output_section);
if (!(strcmp (name, ".sdata2") == 0
|| strcmp (name, ".sbss2") == 0))
{
break;
}
- name = bfd_get_section_name (output_bfd, sec->output_section);
+ name = bfd_section_name (sec->output_section);
if (strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0)
{
break;
}
- name = bfd_get_section_name (output_bfd, sec->output_section);
+ name = bfd_section_name (sec->output_section);
if (strcmp (name, ".sdata") == 0
|| strcmp (name, ".sbss") == 0)
sda = htab->sdata[0].sym;
symtab_hdr->sh_link,
sym->st_name);
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (sym->st_name == 0) ? bfd_section_name (input_bfd, sec) : name;
+ name = sym->st_name == 0 ? bfd_section_name (sec) : name;
}
else
{
flags);
elf_hash_table (info)->splt = splt;
if (splt == NULL
- || ! bfd_set_section_alignment (dynobj, splt, 1))
+ || !bfd_set_section_alignment (splt, 1))
return FALSE;
}
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (sym->st_name == 0) ? bfd_section_name (input_bfd, sec) : name;
+ name = sym->st_name == 0 ? bfd_section_name (sec) : name;
}
else
{
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0)
relocs = TRUE;
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
| SEC_LINKER_CREATED
| SEC_READONLY));
if (sreloc == NULL
- || ! bfd_set_section_alignment (dynobj, sreloc,
- SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
+ || !bfd_set_section_alignment (sreloc,
+ SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
return NULL;
}
return sreloc;
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
elf_hash_table (info)->sgot = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 4))
+ || !bfd_set_section_alignment (s, 4))
return FALSE;
/* Define the symbol _GLOBAL_OFFSET_TABLE_. We don't do this in the
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".scommon") == 0)
{
*retval = SHN_SCORE_SCOMMON;
return TRUE;
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (CONST_STRNEQ (name, ".rel"))
{
the linker now does not create empty output sections. */
if (s->output_section != NULL
&& strcmp (name,
- bfd_get_section_name (s->output_section->owner,
- s->output_section)) == 0)
+ bfd_section_name (s->output_section)) == 0)
s->flags |= SEC_EXCLUDE;
}
else
assert a DT_TEXTREL entry rather than testing whether
there exists a relocation to a read only section or
not. */
- outname = bfd_get_section_name (output_bfd, s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 4);
if ((target != NULL
&& (target->flags & SEC_READONLY) != 0
s = bfd_get_linker_section (abfd, ".dynamic");
if (s != NULL)
{
- if (!bfd_set_section_flags (abfd, s, flags))
+ if (!bfd_set_section_flags (s, flags))
return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME,
flags | SEC_CODE);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
}
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".got") == 0
|| strcmp (name, ".srdata") == 0
{
if (hdr->bfd_section != NULL)
{
- const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+ const char *name = bfd_section_name (hdr->bfd_section);
if (strcmp (name, ".sdata") == 0)
{
| SEC_LINKER_CREATED
| SEC_READONLY));
if (sreloc == NULL
- || ! bfd_set_section_alignment (dynobj, sreloc,
- SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
+ || !bfd_set_section_alignment (sreloc,
+ SCORE_ELF_LOG_FILE_ALIGN (dynobj)))
return NULL;
}
return sreloc;
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
elf_hash_table (info)->sgot = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 4))
+ || !bfd_set_section_alignment (s, 4))
return FALSE;
/* Define the symbol _GLOBAL_OFFSET_TABLE_. We don't do this in the
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".scommon") == 0)
{
*retval = SHN_SCORE_SCOMMON;
return TRUE;
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (CONST_STRNEQ (name, ".rel"))
{
the linker now does not create empty output sections. */
if (s->output_section != NULL
&& strcmp (name,
- bfd_get_section_name (s->output_section->owner,
- s->output_section)) == 0)
+ bfd_section_name (s->output_section)) == 0)
s->flags |= SEC_EXCLUDE;
}
else
assert a DT_TEXTREL entry rather than testing whether
there exists a relocation to a read only section or
not. */
- outname = bfd_get_section_name (output_bfd, s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 4);
if ((target != NULL
&& (target->flags & SEC_READONLY) != 0
s = bfd_get_linker_section (abfd, ".dynamic");
if (s != NULL)
{
- if (!bfd_set_section_flags (abfd, s, flags))
+ if (!bfd_set_section_flags (s, flags))
return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd, SCORE_ELF_STUB_SECTION_NAME,
flags | SEC_CODE);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
}
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".got") == 0
|| strcmp (name, ".srdata") == 0
{
if (hdr->bfd_section != NULL)
{
- const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+ const char *name = bfd_section_name (hdr->bfd_section);
if (strcmp (name, ".sdata") == 0)
{
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (htab->sfuncdesc == NULL
- || ! bfd_set_section_alignment (dynobj, htab->sfuncdesc, 2))
+ || !bfd_set_section_alignment (htab->sfuncdesc, 2))
return FALSE;
htab->srelfuncdesc = bfd_make_section_anyway_with_flags (dynobj,
| SEC_LINKER_CREATED
| SEC_READONLY));
if (htab->srelfuncdesc == NULL
- || ! bfd_set_section_alignment (dynobj, htab->srelfuncdesc, 2))
+ || !bfd_set_section_alignment (htab->srelfuncdesc, 2))
return FALSE;
/* Also create .rofixup. */
| SEC_LINKER_CREATED
| SEC_READONLY));
if (htab->srofixup == NULL
- || ! bfd_set_section_alignment (dynobj, htab->srofixup, 2))
+ || !bfd_set_section_alignment (htab->srofixup, 2))
return FALSE;
return TRUE;
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
htab->root.splt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
if (bed->want_plt_sym)
flags | SEC_READONLY);
htab->root.srelplt = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
if (htab->root.sgot == NULL
flags | SEC_READONLY);
htab->srelbss = s;
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, ptralign))
+ || !bfd_set_section_alignment (s, ptralign))
return FALSE;
}
}
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->root.srelplt && s != htab->srelplt2)
relocs = TRUE;
symname = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
if (symname == NULL || *symname == '\0')
- symname = bfd_section_name (input_bfd, sec);
+ symname = bfd_section_name (sec);
relocation = (sec->output_section->vma
+ sec->output_offset
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
flags = SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
s = bfd_make_section_anyway_with_flags (ibfd, SPU_PTNOTE_SPUNAME, flags);
if (s == NULL
- || !bfd_set_section_alignment (ibfd, s, 4))
+ || !bfd_set_section_alignment (s, 4))
return FALSE;
/* Because we didn't set SEC_LINKER_CREATED we need to set the
proper section type. */
size = 12 + ((sizeof (SPU_PLUGIN_NAME) + 3) & -4);
size += (name_len + 3) & -4;
- if (!bfd_set_section_size (ibfd, s, size))
+ if (!bfd_set_section_size (s, size))
return FALSE;
data = bfd_zalloc (ibfd, size);
flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY | SEC_HAS_CONTENTS
| SEC_IN_MEMORY | SEC_LINKER_CREATED);
s = bfd_make_section_anyway_with_flags (ibfd, ".fixup", flags);
- if (s == NULL || !bfd_set_section_alignment (ibfd, s, 2))
+ if (s == NULL || !bfd_set_section_alignment (s, 2))
return FALSE;
htab->sfixup = s;
}
stub = bfd_make_section_anyway_with_flags (ibfd, ".stub", flags);
htab->stub_sec[0] = stub;
if (stub == NULL
- || !bfd_set_section_alignment (ibfd, stub,
+ || !bfd_set_section_alignment (stub,
ovl_stub_size_log2 (htab->params)))
return 0;
stub->size = htab->stub_count[0] * ovl_stub_size (htab->params);
stub = bfd_make_section_anyway_with_flags (ibfd, ".stub", flags);
htab->stub_sec[ovl] = stub;
if (stub == NULL
- || !bfd_set_section_alignment (ibfd, stub,
+ || !bfd_set_section_alignment (stub,
ovl_stub_size_log2 (htab->params)))
return 0;
stub->size = htab->stub_count[ovl] * ovl_stub_size (htab->params);
flags = SEC_ALLOC;
htab->ovtab = bfd_make_section_anyway_with_flags (ibfd, ".ovtab", flags);
if (htab->ovtab == NULL
- || !bfd_set_section_alignment (ibfd, htab->ovtab, 4))
+ || !bfd_set_section_alignment (htab->ovtab, 4))
return 0;
htab->ovtab->size = (16 + 16 + (16 << htab->fromelem_size_log2))
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
htab->init = bfd_make_section_anyway_with_flags (ibfd, ".ovini", flags);
if (htab->init == NULL
- || !bfd_set_section_alignment (ibfd, htab->init, 4))
+ || !bfd_set_section_alignment (htab->init, 4))
return 0;
htab->init->size = 16;
flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY;
htab->ovtab = bfd_make_section_anyway_with_flags (ibfd, ".ovtab", flags);
if (htab->ovtab == NULL
- || !bfd_set_section_alignment (ibfd, htab->ovtab, 4))
+ || !bfd_set_section_alignment (htab->ovtab, 4))
return 0;
htab->ovtab->size = htab->num_overlays * 16 + 16 + htab->num_buf * 4;
htab->toe = bfd_make_section_anyway_with_flags (ibfd, ".toe", SEC_ALLOC);
if (htab->toe == NULL
- || !bfd_set_section_alignment (ibfd, htab->toe, 4))
+ || !bfd_set_section_alignment (htab->toe, 4))
return 0;
htab->toe->size = 16;
(_("%pB(%s+%#" PRIx64 "): "
"unresolvable %s relocation against symbol `%s'"),
input_bfd,
- bfd_get_section_name (input_bfd, input_section),
+ bfd_section_name (input_section),
(uint64_t) rel->r_offset,
howto->name,
sym_name);
}
bfd_boolean
-spu_elf_size_sections (bfd * output_bfd, struct bfd_link_info *info)
+spu_elf_size_sections (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info)
{
struct spu_link_hash_table *htab = spu_hash_table (info);
if (htab->params->emit_fixups)
/* We always have a NULL fixup as a sentinel */
size = (fixup_count + 1) * FIXUP_RECORD_SIZE;
- if (!bfd_set_section_size (output_bfd, sfixup, size))
+ if (!bfd_set_section_size (sfixup, size))
return FALSE;
sfixup->contents = (bfd_byte *) bfd_zalloc (info->input_bfds, size);
if (sfixup->contents == NULL)
htab->dsbt = bfd_make_section_anyway_with_flags (dynobj, ".dsbt",
flags);
if (htab->dsbt == NULL
- || ! bfd_set_section_alignment (dynobj, htab->dsbt, 2)
- || ! bfd_set_section_alignment (dynobj, htab->elf.splt, 5))
+ || !bfd_set_section_alignment (htab->dsbt, 2)
+ || !bfd_set_section_alignment (htab->elf.splt, 5))
return FALSE;
return TRUE;
{
const char * name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (is_tic6x_elf_unwind_section_name (name))
{
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r)
*secp = bfd_make_section_old_way (abfd, ".scommon");
(*secp)->flags |= SEC_IS_COMMON;
*valp = sym->st_size;
- (void) bfd_set_section_alignment (abfd, *secp, bfd_log2 (sym->st_value));
+ bfd_set_section_alignment (*secp, bfd_log2 (sym->st_value));
break;
}
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".scommon") == 0)
{
*retval = SHN_TIC6X_SCOMMON;
return TRUE;
if (s == htab->elf.splt && s->size > 0)
s->size = (s->size + 31) & ~(bfd_vma)31;
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0
&& s != htab->elf.srelplt)
if (!exidx_sec->rawsize)
exidx_sec->rawsize = exidx_sec->size;
- bfd_set_section_size (exidx_sec->owner, exidx_sec, exidx_sec->size + adjust);
+ bfd_set_section_size (exidx_sec, exidx_sec->size + adjust);
out_sec = exidx_sec->output_section;
/* Adjust size of output section. */
- bfd_set_section_size (out_sec->owner, out_sec, out_sec->size +adjust);
+ bfd_set_section_size (out_sec, out_sec->size +adjust);
}
/* Insert an EXIDX_CANTUNWIND marker at the end of a section. */
(bed->dynamic_sec_flags
| SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->srelgot = s;
s = s_got = bfd_make_section_with_flags (abfd, ".got", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgot = s;
{
s = bfd_make_section_with_flags (abfd, ".got.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgotplt = s;
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r_type)
if (h && h->root.type == bfd_link_hash_common
&& h->root.u.c.p
- && !strcmp (bfd_get_section_name (abfd, h->root.u.c.p->section), "COMMON"))
+ && !strcmp (bfd_section_name (h->root.u.c.p->section), "COMMON"))
{
asection * section;
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch ((int) r)
if (s == NULL)
return NULL;
- if (!bfd_set_section_alignment (abfd, s, 2))
+ if (!bfd_set_section_alignment (s, 2))
return NULL;
/* Allocate space for all known notes. */
- if (!bfd_set_section_size (abfd, s, NUM_V850_NOTES * SIZEOF_V850_NOTE))
+ if (!bfd_set_section_size (s, NUM_V850_NOTES * SIZEOF_V850_NOTE))
return NULL;
data = bfd_zalloc (abfd, NUM_V850_NOTES * SIZEOF_V850_NOTE);
if ((inotes = bfd_get_section_by_name (ibfd, V850_NOTE_SECNAME)) == NULL)
return;
- if (bfd_section_size (ibfd, inotes) == bfd_section_size (obfd, onotes))
+ if (bfd_section_size (inotes) == bfd_section_size (onotes))
{
bfd_byte * icont;
bfd_byte * ocont;
return;
/* Copy/overwrite notes from the input to the output. */
- memcpy (ocont, icont, bfd_section_size (obfd, onotes));
+ memcpy (ocont, icont, bfd_section_size (onotes));
}
}
bfd_byte * icont;
bfd_byte * ocont;
- BFD_ASSERT (bfd_section_size (ibfd, inotes) == bfd_section_size (obfd, onotes));
+ BFD_ASSERT (bfd_section_size (inotes) == bfd_section_size (onotes));
if ((icont = elf_section_data (inotes)->this_hdr.contents) == NULL)
BFD_ASSERT (bfd_malloc_and_get_section (ibfd, inotes, & icont));
if (notes == NULL || notes->contents == NULL)
return;
- BFD_ASSERT (bfd_section_size (abfd, notes) == NUM_V850_NOTES * SIZEOF_V850_NOTE);
+ BFD_ASSERT (bfd_section_size (notes) == NUM_V850_NOTES * SIZEOF_V850_NOTE);
for (id = V850_NOTE_ALIGNMENT; id <= NUM_V850_NOTES; id++)
print_v850_note (abfd, file, notes->contents, id);
asection *sec,
int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".scommon") == 0)
*retval = SHN_V850_SCOMMON;
- else if (strcmp (bfd_get_section_name (abfd, sec), ".tcommon") == 0)
+ else if (strcmp (bfd_section_name (sec), ".tcommon") == 0)
*retval = SHN_V850_TCOMMON;
- else if (strcmp (bfd_get_section_name (abfd, sec), ".zcommon") == 0)
+ else if (strcmp (bfd_section_name (sec), ".zcommon") == 0)
*retval = SHN_V850_ZCOMMON;
else
return FALSE;
case SHT_V850_SCOMMON:
case SHT_V850_TCOMMON:
case SHT_V850_ZCOMMON:
- if (! bfd_set_section_flags (abfd, hdr->bfd_section,
- (bfd_get_section_flags (abfd,
- hdr->bfd_section)
- | SEC_IS_COMMON)))
+ if (!bfd_set_section_flags (hdr->bfd_section,
+ (bfd_section_flags (hdr->bfd_section)
+ | SEC_IS_COMMON)))
return FALSE;
}
{
const char * name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".scommon") == 0)
hdr->sh_type = SHT_V850_SCOMMON;
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (strcmp (name, ".plt") == 0)
{
section, then we probably need a DT_TEXTREL
entry. .rela.plt is actually associated with
.got.plt, which is never readonly. */
- outname = bfd_get_section_name (output_bfd,
- s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 5);
if (target != NULL
&& (target->flags & SEC_READONLY) != 0
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
info->callbacks->reloc_overflow
(info, (h ? &h->root : NULL), name, howto->name,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
flags);
elf_hash_table (info)->splt = splt;
if (splt == NULL
- || ! bfd_set_section_alignment (dynobj, splt, 1))
+ || !bfd_set_section_alignment (splt, 1))
return FALSE;
}
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (ELF32_R_TYPE (rel->r_info))
/* Mark the ".got.plt" section READONLY. */
if (htab->elf.sgotplt == NULL
- || ! bfd_set_section_flags (dynobj, htab->elf.sgotplt, flags))
+ || !bfd_set_section_flags (htab->elf.sgotplt, flags))
return FALSE;
/* Create ".got.loc" (literal tables for use by dynamic linker). */
htab->sgotloc = bfd_make_section_anyway_with_flags (dynobj, ".got.loc",
flags);
if (htab->sgotloc == NULL
- || ! bfd_set_section_alignment (dynobj, htab->sgotloc, 2))
+ || !bfd_set_section_alignment (htab->sgotloc, 2))
return FALSE;
/* Create ".xt.lit.plt" (literal table for ".got.plt*"). */
htab->spltlittbl = bfd_make_section_anyway_with_flags (dynobj, ".xt.lit.plt",
noalloc_flags);
if (htab->spltlittbl == NULL
- || ! bfd_set_section_alignment (dynobj, htab->spltlittbl, 2))
+ || !bfd_set_section_alignment (htab->spltlittbl, 2))
return FALSE;
return TRUE;
sprintf (sname, ".plt.%u", chunk);
s = bfd_make_section_anyway_with_flags (dynobj, sname, flags | SEC_CODE);
if (s == NULL
- || ! bfd_set_section_alignment (dynobj, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
sname = (char *) bfd_malloc (14);
sprintf (sname, ".got.plt.%u", chunk);
s = bfd_make_section_anyway_with_flags (dynobj, sname, flags);
if (s == NULL
- || ! bfd_set_section_alignment (dynobj, s, 2))
+ || !bfd_set_section_alignment (s, 2))
return FALSE;
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (CONST_STRNEQ (name, ".rela"))
{
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r_symndx != STN_UNDEF
if (! prop_sec)
{
flagword flags = (SEC_RELOC | SEC_HAS_CONTENTS | SEC_READONLY);
- flags |= (bfd_get_section_flags (sec->owner, sec)
+ flags |= (bfd_section_flags (sec)
& (SEC_LINK_ONCE | SEC_LINK_DUPLICATES));
prop_sec = bfd_make_section_anyway_with_flags
if (hdr->sh_type == SHT_ALPHA_DEBUG)
{
- if (! bfd_set_section_flags (abfd, newsect,
- (bfd_get_section_flags (abfd, newsect)
- | SEC_DEBUGGING)))
+ if (!bfd_set_section_flags (newsect,
+ bfd_section_flags (newsect) | SEC_DEBUGGING))
return FALSE;
}
{
register const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".mdebug") == 0)
{
| SEC_LINKER_CREATED);
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
alpha_elf_tdata (abfd)->got = s;
| (elf64_alpha_use_secureplt ? SEC_READONLY : 0));
s = bfd_make_section_anyway_with_flags (abfd, ".plt", flags);
elf_hash_table (info)->splt = s;
- if (s == NULL || ! bfd_set_section_alignment (abfd, s, 4))
+ if (s == NULL || ! bfd_set_section_alignment (s, 4))
return FALSE;
/* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
| SEC_LINKER_CREATED | SEC_READONLY);
s = bfd_make_section_anyway_with_flags (abfd, ".rela.plt", flags);
elf_hash_table (info)->srelplt = s;
- if (s == NULL || ! bfd_set_section_alignment (abfd, s, 3))
+ if (s == NULL || ! bfd_set_section_alignment (s, 3))
return FALSE;
if (elf64_alpha_use_secureplt)
flags = SEC_ALLOC | SEC_LINKER_CREATED;
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
elf_hash_table (info)->sgotplt = s;
- if (s == NULL || ! bfd_set_section_alignment (abfd, s, 3))
+ if (s == NULL || ! bfd_set_section_alignment (s, 3))
return FALSE;
}
s = bfd_make_section_anyway_with_flags (abfd, ".rela.got", flags);
elf_hash_table (info)->srelgot = s;
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
/* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the
h->esym.asym.sc = scUndefined;
else
{
- name = bfd_section_name (output_section->owner, output_section);
+ name = bfd_section_name (output_section);
if (strcmp (name, ".text") == 0)
h->esym.asym.sc = scText;
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if (CONST_STRNEQ (name, ".rela"))
{
if (name == NULL)
name = _("<unknown>");
else if (name[0] == 0)
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
_bfd_error_handler
/* xgettext:c-format */
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root.root : NULL), name, howto->name,
name = bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name);
- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+ name = name == NULL ? bfd_section_name (sec) : name;
}
else
{
| SEC_LINKER_CREATED
| SEC_READONLY));
if (srel == NULL
- || !bfd_set_section_alignment (dynobj, srel, 3))
+ || !bfd_set_section_alignment (srel, 3))
return FALSE;
}
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (!opd
- || !bfd_set_section_alignment (abfd, opd, 3))
+ || !bfd_set_section_alignment (opd, 3))
{
BFD_ASSERT (0);
return FALSE;
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (!plt
- || !bfd_set_section_alignment (abfd, plt, 3))
+ || !bfd_set_section_alignment (plt, 3))
{
BFD_ASSERT (0);
return FALSE;
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (!dlt
- || !bfd_set_section_alignment (abfd, dlt, 3))
+ || !bfd_set_section_alignment (dlt, 3))
{
BFD_ASSERT (0);
return FALSE;
| SEC_READONLY
| SEC_LINKER_CREATED));
if (!stub
- || !bfd_set_section_alignment (abfd, stub, 3))
+ || !bfd_set_section_alignment (stub, 3))
{
BFD_ASSERT (0);
return FALSE;
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
hppa_info->dlt_rel_sec = s;
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
hppa_info->plt_rel_sec = s;
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
hppa_info->other_rel_sec = s;
| SEC_READONLY
| SEC_LINKER_CREATED));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
hppa_info->opd_rel_sec = s;
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".plt") == 0)
{
entry. The entries in the .rela.plt section
really apply to the .got section, which we
created ourselves and so know is not readonly. */
- outname = bfd_get_section_name (output_bfd,
- sec->output_section);
+ outname = bfd_section_name (sec->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 4);
if (target != NULL
&& (target->flags & SEC_READONLY) != 0
if (sym_name == NULL)
return FALSE;
if (*sym_name == '\0')
- sym_name = bfd_section_name (input_bfd, sym_sec);
+ sym_name = bfd_section_name (sym_sec);
}
(*info->callbacks->reloc_overflow)
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (is_unwind_section_name (abfd, name))
{
s = bfd_make_section_anyway_with_flags (abfd, ".dynamic",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
s = bfd_make_section_anyway_with_flags (abfd, ".plt", flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
ia64_info->root.splt = s;
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 0))
+ || !bfd_set_section_alignment (s, 0))
return FALSE;
/* Create a fixup section. */
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
ia64_info->fixups_sec = s;
| SEC_IN_MEMORY
| SEC_LINKER_CREATED));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
s->size = sizeof (struct elf64_vms_transfer);
ia64_info->transfer_sec = s;
| SEC_IN_MEMORY
| SEC_READONLY));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, 3))
+ || !bfd_set_section_alignment (s, 3))
return FALSE;
ia64_info->note_sec = s;
got = bfd_make_section_anyway_with_flags (dynobj, ".got",
flags | SEC_SMALL_DATA);
if (got == NULL
- || !bfd_set_section_alignment (dynobj, got, 3))
+ || !bfd_set_section_alignment (got, 3))
return NULL;
ia64_info->root.sgot = got;
}
: SEC_READONLY)
| SEC_LINKER_CREATED));
if (!fptr
- || !bfd_set_section_alignment (dynobj, fptr, 4))
+ || !bfd_set_section_alignment (fptr, 4))
{
BFD_ASSERT (0);
return NULL;
| SEC_LINKER_CREATED
| SEC_READONLY));
if (fptr_rel == NULL
- || !bfd_set_section_alignment (dynobj, fptr_rel, 3))
+ || !bfd_set_section_alignment (fptr_rel, 3))
{
BFD_ASSERT (0);
return NULL;
| SEC_SMALL_DATA
| SEC_LINKER_CREATED));
if (!pltoff
- || !bfd_set_section_alignment (dynobj, pltoff, 4))
+ || !bfd_set_section_alignment (pltoff, 4))
{
BFD_ASSERT (0);
return NULL;
return NULL;
BFD_ASSERT ((CONST_STRNEQ (srel_name, ".rela")
- && strcmp (bfd_get_section_name (abfd, sec),
- srel_name+5) == 0)
+ && strcmp (bfd_section_name (sec), srel_name+5) == 0)
|| (CONST_STRNEQ (srel_name, ".rel")
- && strcmp (bfd_get_section_name (abfd, sec),
- srel_name+4) == 0));
+ && strcmp (bfd_section_name (sec), srel_name+4) == 0));
dynobj = ia64_info->root.dynobj;
if (!dynobj)
| SEC_LINKER_CREATED
| SEC_READONLY));
if (srel == NULL
- || !bfd_set_section_alignment (dynobj, srel, 3))
+ || !bfd_set_section_alignment (srel, 3))
return NULL;
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".got.plt") == 0)
strip = FALSE;
{
asection *newsect = hdr->bfd_section;
- if (! bfd_set_section_flags
- (abfd, newsect, bfd_get_section_flags (abfd, newsect) | secflags))
+ if (!bfd_set_section_flags (newsect,
+ bfd_section_flags (newsect) | secflags))
return FALSE;
}
{
if (hdr->bfd_section != NULL)
{
- const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+ const char *name = bfd_section_name (hdr->bfd_section);
if (strcmp (name, ".text") == 0)
hdr->sh_flags |= SHF_IA_64_VMS_SHARED;
{
hdr = &elf_section_data (s)->this_hdr;
- if (strcmp (bfd_get_section_name (abfd, hdr->bfd_section),
+ if (strcmp (bfd_section_name (hdr->bfd_section),
".IA_64.unwind_info") == 0)
unwind_info_sect_idx = elf_section_data (s)->this_idx;
symtab_hdr->sh_link,
sym->st_name);
if (name == NULL)
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
else
{
return bfd_reloc_undefined;
/* Check that we're not relocating against a register symbol. */
- if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+ if (strcmp (bfd_section_name (symsec),
MMIX_REG_CONTENTS_SECTION_NAME) == 0
- || strcmp (bfd_get_section_name (symsec->owner, symsec),
+ || strcmp (bfd_section_name (symsec),
MMIX_REG_SECTION_NAME) == 0)
{
/* Note: This is separated out into two messages in order
if (symsec == NULL)
return bfd_reloc_undefined;
- if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+ if (strcmp (bfd_section_name (symsec),
MMIX_REG_CONTENTS_SECTION_NAME) == 0)
{
if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8)
}
srel /= 8;
}
- else if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+ else if (strcmp (bfd_section_name (symsec),
MMIX_REG_SECTION_NAME) == 0)
{
if (srel < 0 || srel > 255)
accidentally handling it. */
if (!bfd_is_abs_section (symsec)
&& !bfd_is_und_section (symsec)
- && strcmp (bfd_get_section_name (symsec->owner, symsec),
+ && strcmp (bfd_section_name (symsec),
MMIX_REG_CONTENTS_SECTION_NAME) != 0
- && strcmp (bfd_get_section_name (symsec->owner, symsec),
+ && strcmp (bfd_section_name (symsec),
MMIX_REG_SECTION_NAME) != 0)
{
_bfd_error_handler
first_global = 255;
else
{
- first_global
- = bfd_get_section_vma (input_section->output_section->owner,
- regsec) / 8;
- if (strcmp (bfd_get_section_name (symsec->owner, symsec),
+ first_global = bfd_section_vma (regsec) / 8;
+ if (strcmp (bfd_section_name (symsec),
MMIX_REG_CONTENTS_SECTION_NAME) == 0)
{
if ((srel & 7) != 0 || srel < 32*8 || srel > 255*8)
those flags, as that is what currently happens for usual
GREG allocations, and that works. */
if (allocated_gregs_section == NULL
- || !bfd_set_section_alignment (bpo_greg_owner,
- allocated_gregs_section,
- 3))
+ || !bfd_set_section_alignment (allocated_gregs_section, 3))
return FALSE;
gregdata = (struct bpo_greg_section_info *)
asection * sec,
int * retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), MMIX_REG_SECTION_NAME) == 0)
+ if (strcmp (bfd_section_name (sec), MMIX_REG_SECTION_NAME) == 0)
*retval = SHN_REGISTER;
else
return FALSE;
if (reg_section != NULL)
{
/* FIXME: Pass error state gracefully. */
- if (bfd_get_section_flags (abfd, reg_section) & SEC_HAS_CONTENTS)
+ if (bfd_section_flags (reg_section) & SEC_HAS_CONTENTS)
_bfd_abort (__FILE__, __LINE__, _("register section has contents\n"));
/* Really remove the section, if it hasn't already been done. */
/* Set the zeroth-order estimate for the GREGs size. */
gregs_size = n_gregs * 8;
- if (!bfd_set_section_size (bpo_greg_owner, bpo_gregs_section, gregs_size))
+ if (!bfd_set_section_size (bpo_gregs_section, gregs_size))
return FALSE;
/* Allocate and set up the GREG arrays. They're filled in at relaxation
htab->sfpr = bfd_make_section_anyway_with_flags (dynobj, ".sfpr",
flags);
if (htab->sfpr == NULL
- || !bfd_set_section_alignment (dynobj, htab->sfpr, 2))
+ || !bfd_set_section_alignment (htab->sfpr, 2))
return FALSE;
}
htab->glink = bfd_make_section_anyway_with_flags (dynobj, ".glink",
flags);
if (htab->glink == NULL
- || !bfd_set_section_alignment (dynobj, htab->glink, 3))
+ || !bfd_set_section_alignment (htab->glink, 3))
return FALSE;
/* The part of .glink used by global entry stubs, separate so that
htab->global_entry = bfd_make_section_anyway_with_flags (dynobj, ".glink",
flags);
if (htab->global_entry == NULL
- || !bfd_set_section_alignment (dynobj, htab->global_entry, 2))
+ || !bfd_set_section_alignment (htab->global_entry, 2))
return FALSE;
if (!info->no_ld_generated_unwind_info)
".eh_frame",
flags);
if (htab->glink_eh_frame == NULL
- || !bfd_set_section_alignment (dynobj, htab->glink_eh_frame, 2))
+ || !bfd_set_section_alignment (htab->glink_eh_frame, 2))
return FALSE;
}
flags = SEC_ALLOC | SEC_LINKER_CREATED;
htab->elf.iplt = bfd_make_section_anyway_with_flags (dynobj, ".iplt", flags);
if (htab->elf.iplt == NULL
- || !bfd_set_section_alignment (dynobj, htab->elf.iplt, 3))
+ || !bfd_set_section_alignment (htab->elf.iplt, 3))
return FALSE;
flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY
htab->elf.irelplt
= bfd_make_section_anyway_with_flags (dynobj, ".rela.iplt", flags);
if (htab->elf.irelplt == NULL
- || !bfd_set_section_alignment (dynobj, htab->elf.irelplt, 3))
+ || !bfd_set_section_alignment (htab->elf.irelplt, 3))
return FALSE;
/* Create branch lookup table for plt_branch stubs. */
htab->brlt = bfd_make_section_anyway_with_flags (dynobj, ".branch_lt",
flags);
if (htab->brlt == NULL
- || !bfd_set_section_alignment (dynobj, htab->brlt, 3))
+ || !bfd_set_section_alignment (htab->brlt, 3))
return FALSE;
/* Local plt entries, put in .branch_lt but a separate section for
htab->pltlocal = bfd_make_section_anyway_with_flags (dynobj, ".branch_lt",
flags);
if (htab->pltlocal == NULL
- || !bfd_set_section_alignment (dynobj, htab->pltlocal, 3))
+ || !bfd_set_section_alignment (htab->pltlocal, 3))
return FALSE;
if (!bfd_link_pic (info))
htab->relbrlt
= bfd_make_section_anyway_with_flags (dynobj, ".rela.branch_lt", flags);
if (htab->relbrlt == NULL
- || !bfd_set_section_alignment (dynobj, htab->relbrlt, 3))
+ || !bfd_set_section_alignment (htab->relbrlt, 3))
return FALSE;
htab->relpltlocal
= bfd_make_section_anyway_with_flags (dynobj, ".rela.branch_lt", flags);
if (htab->relpltlocal == NULL
- || !bfd_set_section_alignment (dynobj, htab->relpltlocal, 3))
+ || !bfd_set_section_alignment (htab->relpltlocal, 3))
return FALSE;
return TRUE;
got = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (!got
- || !bfd_set_section_alignment (abfd, got, 3))
+ || !bfd_set_section_alignment (got, 3))
return FALSE;
relgot = bfd_make_section_anyway_with_flags (abfd, ".rela.got",
flags | SEC_READONLY);
if (!relgot
- || !bfd_set_section_alignment (abfd, relgot, 3))
+ || !bfd_set_section_alignment (relgot, 3))
return FALSE;
ppc64_elf_tdata (abfd)->got = got;
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->elf.srelplt)
relocs = TRUE;
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".stab") == 0)
{
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r == bfd_reloc_overflow)
(bed->dynamic_sec_flags
| SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->srelgot = s;
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgot = s;
{
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgotplt = s;
}
s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version_d",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 1))
+ || !bfd_set_section_alignment (s, 1))
return FALSE;
s = bfd_make_section_anyway_with_flags (abfd, ".gnu.version_r",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
s = bfd_make_section_anyway_with_flags (abfd, ".dynsym",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
elf_hash_table (info)->dynsym = s;
s = bfd_make_section_anyway_with_flags (abfd, ".dynamic", flags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
/* The special symbol _DYNAMIC is always set to the start of the
s = bfd_make_section_anyway_with_flags (abfd, ".hash",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry;
}
s = bfd_make_section_anyway_with_flags (abfd, ".gnu.hash",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
/* For 64-bit ELF, .gnu.hash is a non-uniform entity size section:
4 32-bit words followed by variable count of 64-bit words, then
s = bfd_make_section_anyway_with_flags (abfd, ".plt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->splt = s;
? ".rela.plt" : ".rel.plt"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->srelplt = s;
? ".rela.bss" : ".rel.bss"),
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->srelbss = s;
? ".rela.data.rel.ro" : ".rel.data.rel.ro"),
flags | SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sreldynrelro = s;
}
know the symbol alignment requirement, we start with the
maximum alignment and check low bits of the symbol address
for the minimum alignment. */
- power_of_two = bfd_get_section_alignment (sec->owner, sec);
+ power_of_two = bfd_section_alignment (sec);
mask = ((bfd_vma) 1 << power_of_two) - 1;
while ((h->root.u.def.value & mask) != 0)
{
--power_of_two;
}
- if (power_of_two > bfd_get_section_alignment (dynbss->owner,
- dynbss))
+ if (power_of_two > bfd_section_alignment (dynbss))
{
/* Adjust the section alignment if needed. */
- if (! bfd_set_section_alignment (dynbss->owner, dynbss,
- power_of_two))
+ if (!bfd_set_section_alignment (dynbss, power_of_two))
return FALSE;
}
{
const char *name;
- name = bfd_get_section_name (abfd, s);
+ name = bfd_section_name (s);
if (CONST_STRNEQ (name, ".gnu.warning."))
{
char *msg;
case bfd_reloc_overflow:
if (link_order->type == bfd_section_reloc_link_order)
- sym_name = bfd_section_name (output_bfd,
- link_order->u.reloc.p->u.section);
+ sym_name = bfd_section_name (link_order->u.reloc.p->u.section);
else
sym_name = link_order->u.reloc.p->u.name;
(*info->callbacks->reloc_overflow) (info, NULL, sym_name,
}
attr_size = bfd_elf_obj_attr_size (abfd);
- bfd_set_section_size (abfd, o, attr_size);
+ bfd_set_section_size (o, attr_size);
/* Skip this section later on. */
o->map_head.link_order = NULL;
if (attr_size)
for (sec = ibfd->sections; sec; sec = sec->next)
{
- if (CONST_STRNEQ (bfd_section_name (ibfd, sec), ".eh_frame_entry")
+ if (CONST_STRNEQ (bfd_section_name (sec), ".eh_frame_entry")
&& init_reloc_cookie_rels (&cookie, info, ibfd, sec))
{
_bfd_elf_parse_eh_frame_entry (info, sec, &cookie);
bfd_boolean is_rela)
{
char *name;
- const char *old_name = bfd_get_section_name (NULL, sec);
+ const char *old_name = bfd_section_name (sec);
const char *prefix = is_rela ? ".rela" : ".rel";
if (old_name == NULL)
section named "auto" we'll get ".relauto" which is
seen to be a .rela section. */
elf_section_type (reloc_sec) = is_rela ? SHT_RELA : SHT_REL;
- if (! bfd_set_section_alignment (dynobj, reloc_sec, alignment))
+ if (!bfd_set_section_alignment (reloc_sec, alignment))
reloc_sec = NULL;
}
}
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
if (r_symndx != 0
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
{
- if ((bfd_get_section_flags (ibfd, sec)
+ if ((bfd_section_flags (sec)
& (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
== (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
only_data_sections = FALSE;
(bed->dynamic_sec_flags
| SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->srelgot = s;
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgot = s;
htab->sgot->size += GOT_ENTRY_SIZE;
{
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgotplt = s;
}
/* Strip this section if we don't need it; see the
comment below. */
}
- else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela"))
+ else if (CONST_STRNEQ (bfd_section_name (s), ".rela"))
{
if (s->size != 0 && s != htab->root.srelplt)
relocs = TRUE;
{
const char *name;
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (is_unwind_section_name (abfd, name))
{
return FALSE;
{
- flagword flags = bfd_get_section_flags (abfd, ia64_info->root.sgot);
- bfd_set_section_flags (abfd, ia64_info->root.sgot,
- SEC_SMALL_DATA | flags);
+ flagword flags = bfd_section_flags (ia64_info->root.sgot);
+ bfd_set_section_flags (ia64_info->root.sgot, SEC_SMALL_DATA | flags);
/* The .got section is always aligned at 8 bytes. */
- if (! bfd_set_section_alignment (abfd, ia64_info->root.sgot, 3))
+ if (!bfd_set_section_alignment (ia64_info->root.sgot, 3))
return FALSE;
}
| SEC_LINKER_CREATED
| SEC_READONLY));
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, LOG_SECTION_ALIGN))
+ || !bfd_set_section_alignment (s, LOG_SECTION_ALIGN))
return FALSE;
ia64_info->rel_pltoff_sec = s;
got = ia64_info->root.sgot;
/* The .got section is always aligned at 8 bytes. */
- if (!bfd_set_section_alignment (abfd, got, 3))
+ if (!bfd_set_section_alignment (got, 3))
return NULL;
- flags = bfd_get_section_flags (abfd, got);
- if (! bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags))
+ flags = bfd_section_flags (got);
+ if (!bfd_set_section_flags (got, SEC_SMALL_DATA | flags))
return NULL;
}
? 0 : SEC_READONLY)
| SEC_LINKER_CREATED));
if (!fptr
- || !bfd_set_section_alignment (abfd, fptr, 4))
+ || !bfd_set_section_alignment (fptr, 4))
{
BFD_ASSERT (0);
return NULL;
| SEC_LINKER_CREATED
| SEC_READONLY));
if (fptr_rel == NULL
- || !bfd_set_section_alignment (abfd, fptr_rel,
- LOG_SECTION_ALIGN))
+ || !bfd_set_section_alignment (fptr_rel, LOG_SECTION_ALIGN))
{
BFD_ASSERT (0);
return NULL;
| SEC_SMALL_DATA
| SEC_LINKER_CREATED));
if (!pltoff
- || !bfd_set_section_alignment (abfd, pltoff, 4))
+ || !bfd_set_section_alignment (pltoff, 4))
{
BFD_ASSERT (0);
return NULL;
| SEC_LINKER_CREATED
| SEC_READONLY));
if (srel == NULL
- || !bfd_set_section_alignment (dynobj, srel,
- LOG_SECTION_ALIGN))
+ || !bfd_set_section_alignment (srel, LOG_SECTION_ALIGN))
return NULL;
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, sec);
+ name = bfd_section_name (sec);
if (strcmp (name, ".got.plt") == 0)
strip = FALSE;
(bed->dynamic_sec_flags
| SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->srelgot = s;
s = s_got = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgot = s;
{
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgotplt = s;
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
resolved_to_zero = (h != NULL
for (sec = ibfd->sections; sec != NULL; sec = sec->next)
{
- if ((bfd_get_section_flags (ibfd, sec)
+ if ((bfd_section_flags (sec)
& (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
== (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS))
only_data_sections = FALSE;
_("%F%P: failed to create GNU property section\n"));
align = (bfd_get_mach (ebfd) & bfd_mach_aarch64_ilp32) ? 2 : 3;
- if (!bfd_set_section_alignment (ebfd, sec, align))
- {
- info->callbacks->einfo (_("%F%pA: failed to align section\n"),
- sec);
- }
+ if (!bfd_set_section_alignment (sec, align))
+ info->callbacks->einfo (_("%F%pA: failed to align section\n"),
+ sec);
elf_section_type (sec) = SHT_NOTE;
}
{
const char *name;
- name = bfd_get_section_name (section->owner, section);
+ name = bfd_section_name (section);
return (FN_STUB_P (name)
|| CALL_STUB_P (name)
|| CALL_FP_STUB_P (name)
/* Make sure that any padding goes before the stub. */
align = input_section->alignment_power;
- if (!bfd_set_section_alignment (s->owner, s, align))
+ if (!bfd_set_section_alignment (s, align))
return FALSE;
if (align > 3)
s->size = (1 << align) - 8;
asection *input_section = stub->h->root.root.u.def.section;
s = htab->add_stub_section (".text", NULL,
input_section->output_section);
- if (s == NULL || !bfd_set_section_alignment (s->owner, s, 4))
+ if (s == NULL || !bfd_set_section_alignment (s, 4))
return FALSE;
htab->strampoline = s;
}
h->esym.asym.sc = scUndefined;
else
{
- name = bfd_section_name (output_section->owner, output_section);
+ name = bfd_section_name (output_section);
if (strcmp (name, ".text") == 0)
h->esym.asym.sc = scText;
| SEC_LINKER_CREATED
| SEC_READONLY));
if (sreloc == NULL
- || ! bfd_set_section_alignment (dynobj, sreloc,
- MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
+ || !bfd_set_section_alignment (sreloc,
+ MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
return NULL;
}
return sreloc;
s = bfd_make_section_anyway_with_flags (abfd, ".compact_rel", flags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+ || !bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd)))
return FALSE;
s->size = sizeof (Elf32_External_compact_rel);
in the function stub generation and in the linker script. */
s = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, 4))
+ || !bfd_set_section_alignment (s, 4))
return FALSE;
htab->root.sgot = s;
symtab_hdr->sh_link,
sym->st_name);
if (*namep == NULL || **namep == '\0')
- *namep = bfd_section_name (input_bfd, sec);
+ *namep = bfd_section_name (sec);
/* For relocations against a section symbol and ones against no
symbol (absolute relocations) infer the ISA mode from the addend. */
sec = NULL;
for (o = input_bfd->sections; o != NULL; o = o->next)
{
- if (CALL_FP_STUB_P (bfd_get_section_name (input_bfd, o)))
+ if (CALL_FP_STUB_P (bfd_section_name (o)))
{
sec = h->call_fp_stub;
break;
if (hdr->bfd_section != NULL)
{
- const char *name = bfd_get_section_name (abfd, hdr->bfd_section);
+ const char *name = bfd_section_name (hdr->bfd_section);
/* .sbss is not handled specially here because the GNU/Linux
prelinker can convert .sbss from NOBITS to PROGBITS and
if (flags)
{
- if (! bfd_set_section_flags (abfd, hdr->bfd_section,
- (bfd_get_section_flags (abfd,
- hdr->bfd_section)
- | flags)))
+ if (!bfd_set_section_flags (hdr->bfd_section,
+ (bfd_section_flags (hdr->bfd_section)
+ | flags)))
return FALSE;
}
bfd_boolean
_bfd_mips_elf_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
{
- const char *name = bfd_get_section_name (abfd, sec);
+ const char *name = bfd_section_name (sec);
if (strcmp (name, ".liblist") == 0)
{
_bfd_mips_elf_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec, int *retval)
{
- if (strcmp (bfd_get_section_name (abfd, sec), ".scommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".scommon") == 0)
{
*retval = SHN_MIPS_SCOMMON;
return TRUE;
}
- if (strcmp (bfd_get_section_name (abfd, sec), ".acommon") == 0)
+ if (strcmp (bfd_section_name (sec), ".acommon") == 0)
{
*retval = SHN_MIPS_ACOMMON;
return TRUE;
s = bfd_get_linker_section (abfd, ".dynamic");
if (s != NULL)
{
- if (! bfd_set_section_flags (abfd, s, flags))
+ if (!bfd_set_section_flags (s, flags))
return FALSE;
}
}
MIPS_ELF_STUB_SECTION_NAME (abfd),
flags | SEC_CODE);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+ || !bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd)))
return FALSE;
htab->sstubs = s;
s = bfd_make_section_anyway_with_flags (abfd, ".rld_map",
flags &~ (flagword) SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- MIPS_ELF_LOG_FILE_ALIGN (abfd)))
+ || !bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd)))
return FALSE;
}
/* Change alignments of some sections. */
s = bfd_get_linker_section (abfd, ".hash");
if (s != NULL)
- (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
s = bfd_get_linker_section (abfd, ".dynsym");
if (s != NULL)
- (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
s = bfd_get_linker_section (abfd, ".dynstr");
if (s != NULL)
- (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
/* ??? */
s = bfd_get_section_by_name (abfd, ".reginfo");
if (s != NULL)
- (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
s = bfd_get_linker_section (abfd, ".dynamic");
if (s != NULL)
- (void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
+ bfd_set_section_alignment (s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
}
if (bfd_link_executable (info))
/* Check for the mips16 stub sections. */
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
if (FN_STUB_P (name))
{
unsigned long r_symndx;
Encourage better cache usage by aligning. We do this
lazily to avoid pessimizing traditional objects. */
if (!htab->is_vxworks
- && !bfd_set_section_alignment (dynobj, htab->root.splt, 5))
+ && !bfd_set_section_alignment (htab->root.splt, 5))
return FALSE;
/* Make sure that .got.plt is word-aligned. We do this lazily
for the same reason as above. */
- if (!bfd_set_section_alignment (dynobj, htab->root.sgotplt,
+ if (!bfd_set_section_alignment (htab->root.sgotplt,
MIPS_ELF_LOG_FILE_ALIGN (dynobj)))
return FALSE;
sect = bfd_get_section_by_name (output_bfd, ".reginfo");
if (sect != NULL)
{
- bfd_set_section_size (output_bfd, sect, sizeof (Elf32_External_RegInfo));
+ bfd_set_section_size (sect, sizeof (Elf32_External_RegInfo));
sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
}
sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags");
if (sect != NULL)
{
- bfd_set_section_size (output_bfd, sect,
- sizeof (Elf_External_ABIFlags_v0));
+ bfd_set_section_size (sect, sizeof (Elf_External_ABIFlags_v0));
sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS;
}
/* It's OK to base decisions on the section name, because none
of the dynobj section names depend upon the input files. */
- name = bfd_get_section_name (dynobj, s);
+ name = bfd_section_name (s);
if ((s->flags & SEC_LINKER_CREATED) == 0)
continue;
assert a DT_TEXTREL entry rather than testing whether
there exists a relocation to a read only section or
not. */
- outname = bfd_get_section_name (output_bfd,
- s->output_section);
+ outname = bfd_section_name (s->output_section);
target = bfd_get_section_by_name (output_bfd, outname + 4);
if ((target != NULL
&& (target->flags & SEC_READONLY) != 0
case SHT_MIPS_GPTAB:
BFD_ASSERT ((*hdrpp)->bfd_section != NULL);
- name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section);
+ name = bfd_section_name ((*hdrpp)->bfd_section);
BFD_ASSERT (name != NULL
&& CONST_STRNEQ (name, ".gptab."));
sec = bfd_get_section_by_name (abfd, name + sizeof ".gptab" - 1);
case SHT_MIPS_CONTENT:
BFD_ASSERT ((*hdrpp)->bfd_section != NULL);
- name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section);
+ name = bfd_section_name ((*hdrpp)->bfd_section);
BFD_ASSERT (name != NULL
&& CONST_STRNEQ (name, ".MIPS.content"));
sec = bfd_get_section_by_name (abfd,
case SHT_MIPS_EVENTS:
BFD_ASSERT ((*hdrpp)->bfd_section != NULL);
- name = bfd_get_section_name (abfd, (*hdrpp)->bfd_section);
+ name = bfd_section_name ((*hdrpp)->bfd_section);
BFD_ASSERT (name != NULL);
if (CONST_STRNEQ (name, ".MIPS.events"))
sec = bfd_get_section_by_name (abfd,
for (o = sub->sections; o != NULL; o = o->next)
if (!o->gc_mark
- && MIPS_ELF_ABIFLAGS_SECTION_NAME_P
- (bfd_get_section_name (sub, o)))
+ && MIPS_ELF_ABIFLAGS_SECTION_NAME_P (bfd_section_name (o)))
{
if (!_bfd_elf_gc_mark (info, o, gc_mark_hook))
return FALSE;
".rtproc",
flags);
if (rtproc_sec == NULL
- || ! bfd_set_section_alignment (abfd, rtproc_sec, 4))
+ || !bfd_set_section_alignment (rtproc_sec, 4))
return FALSE;
}
s = bfd_make_section_with_flags (abfd, ".iplt", pltflags);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
+ || !bfd_set_section_alignment (s, bed->plt_alignment))
return FALSE;
htab->iplt = s;
s = bfd_make_section_with_flags (abfd, ".rela.iplt",
flags | SEC_READONLY);
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->irelplt = s;
|| r_type == R_SPARC_UA32
|| r_type == R_SPARC_DISP32)
&& (((input_section->flags & SEC_DEBUGGING) != 0
- && strcmp (bfd_section_name (input_bfd,
- input_section),
+ && strcmp (bfd_section_name (input_section),
".stab") == 0)
|| _bfd_elf_section_offset (output_bfd, info,
input_section,
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
(*info->callbacks->reloc_overflow)
(info, (h ? &h->root : NULL), name, howto->name,
(bed->dynamic_sec_flags
| SEC_READONLY));
if (s == NULL
- || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->srelgot = s;
s = s_got = bfd_make_section_anyway_with_flags (abfd, ".got", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgot = s;
{
s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags);
if (s == NULL
- || !bfd_set_section_alignment (abfd, s,
- bed->s->log_file_align))
+ || !bfd_set_section_alignment (s, bed->s->log_file_align))
return FALSE;
htab->sgotplt = s;
name = (bfd_elf_string_from_elf_section
(input_bfd, symtab_hdr->sh_link, sym->st_name));
if (name == NULL || *name == '\0')
- name = bfd_section_name (input_bfd, sec);
+ name = bfd_section_name (sec);
}
switch (r_type)
{
/* Strip these too. */
}
- else if (htab->is_reloc_section (bfd_get_section_name (dynobj, s)))
+ else if (htab->is_reloc_section (bfd_section_name (s)))
{
if (s->size != 0
&& s != htab->elf.srelplt
it is empty. Update its section alignment now since it
is non-empty. */
if (s == htab->elf.iplt)
- bfd_set_section_alignment (s->owner, s,
- htab->plt.iplt_alignment);
+ bfd_set_section_alignment (s, htab->plt.iplt_alignment);
/* Allocate memory for the section contents. We use bfd_zalloc
here in case unused entries are not reclaimed before the
if (sec == NULL)
info->callbacks->einfo (_("%F%P: failed to create GNU property section\n"));
- if (!bfd_set_section_alignment (ebfd, sec, class_align))
+ if (!bfd_set_section_alignment (sec, class_align))
{
error_alignment:
info->callbacks->einfo (_("%F%pA: failed to align section\n"),
instead of in create_dynamic_sections so that they are always
properly aligned even if create_dynamic_sections isn't called. */
sec = htab->elf.sgot;
- if (!bfd_set_section_alignment (dynobj, sec, got_align))
+ if (!bfd_set_section_alignment (sec, got_align))
goto error_alignment;
sec = htab->elf.sgotplt;
- if (!bfd_set_section_alignment (dynobj, sec, got_align))
+ if (!bfd_set_section_alignment (sec, got_align))
goto error_alignment;
/* Create the ifunc sections here so that check_relocs can be
= bfd_log2 (htab->non_lazy_plt->plt_entry_size);
sec = pltsec;
- if (!bfd_set_section_alignment (sec->owner, sec,
- plt_alignment))
+ if (!bfd_set_section_alignment (sec, plt_alignment))
goto error_alignment;
/* Create the GOT procedure linkage table. */
if (sec == NULL)
info->callbacks->einfo (_("%F%P: failed to create GOT PLT section\n"));
- if (!bfd_set_section_alignment (dynobj, sec,
- non_lazy_plt_alignment))
+ if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
goto error_alignment;
htab->plt_got = sec;
if (sec == NULL)
info->callbacks->einfo (_("%F%P: failed to create IBT-enabled PLT section\n"));
- if (!bfd_set_section_alignment (dynobj, sec,
- plt_alignment))
+ if (!bfd_set_section_alignment (sec, plt_alignment))
goto error_alignment;
}
else if (htab->params->bndplt && ABI_64_P (dynobj))
if (sec == NULL)
info->callbacks->einfo (_("%F%P: failed to create BND PLT section\n"));
- if (!bfd_set_section_alignment (dynobj, sec,
- non_lazy_plt_alignment))
+ if (!bfd_set_section_alignment (sec, non_lazy_plt_alignment))
goto error_alignment;
}
if (sec == NULL)
info->callbacks->einfo (_("%F%P: failed to create PLT .eh_frame section\n"));
- if (!bfd_set_section_alignment (dynobj, sec, class_align))
+ if (!bfd_set_section_alignment (sec, class_align))
goto error_alignment;
htab->plt_eh_frame = sec;
if (sec == NULL)
info->callbacks->einfo (_("%F%P: failed to create GOT PLT .eh_frame section\n"));
- if (!bfd_set_section_alignment (dynobj, sec, class_align))
+ if (!bfd_set_section_alignment (sec, class_align))
goto error_alignment;
htab->plt_got_eh_frame = sec;
if (sec == NULL)
info->callbacks->einfo (_("%F%P: failed to create the second PLT .eh_frame section\n"));
- if (!bfd_set_section_alignment (dynobj, sec, class_align))
+ if (!bfd_set_section_alignment (sec, class_align))
goto error_alignment;
htab->plt_second_eh_frame = sec;
section backwards, resulting in a warning and section lma not
being set properly. It later leads to a "File truncated"
error. */
- if (!bfd_set_section_alignment (sec->owner, sec, 0))
+ if (!bfd_set_section_alignment (sec, 0))
goto error_alignment;
htab->plt.iplt_alignment = (normal_target
return NULL;
}
- bfd_set_section_size (abfd, section, size);
+ bfd_set_section_size (section, size);
section->alignment_power = 4;
return abfd->xvec;
{
if (sec->size == 0)
continue;
- if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ if (bfd_section_flags (sec) & SEC_ALLOC)
{
- bfd_vma sec_vma = bfd_get_section_vma (abfd, sec) + sec->size;
+ bfd_vma sec_vma = bfd_section_vma (sec) + sec->size;
if (sec_vma > high_vma)
high_vma = sec_vma;
}
- if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
+ if (bfd_section_flags (sec) & SEC_LOAD)
{
file_ptr sec_end = (sizeof (hdr)
- + bfd_get_section_vma (abfd, sec)
+ + bfd_section_vma (sec)
+ sec->size);
if (sec_end > outfile_size)
outfile_size = sec_end;
if (count == 0)
return TRUE;
- section->filepos = EXE_PAGE_SIZE + bfd_get_section_vma (abfd, section);
+ section->filepos = EXE_PAGE_SIZE + bfd_section_vma (section);
- if (bfd_get_section_flags (abfd, section) & SEC_LOAD)
+ if (bfd_section_flags (section) & SEC_LOAD)
{
if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0
|| bfd_bwrite (location, count, abfd) != count)
(*info->callbacks->reloc_overflow)
(info, NULL,
(link_order->type == bfd_section_reloc_link_order
- ? bfd_section_name (abfd, link_order->u.reloc.p->u.section)
+ ? bfd_section_name (link_order->u.reloc.p->u.section)
: link_order->u.reloc.p->u.name),
r->howto->name, link_order->u.reloc.p->addend,
NULL, NULL, 0);
into a single large link once section, which defeats the purpose
of having link once sections in the first place. */
- name = bfd_get_section_name (abfd, sec);
+ name = bfd_section_name (sec);
already_linked_list = bfd_section_already_linked_table_lookup (name);
bfd_mach_o_section *section)
{
const mach_o_section_name_xlat *xlat;
- const char *name = bfd_get_section_name (abfd, sect);
+ const char *name = bfd_section_name (sect);
const char *segname;
const char *dot;
unsigned int len;
target_index = 0;
for (sec = abfd->sections; sec; sec = sec->next)
{
- unsigned bfd_align = bfd_get_section_alignment (abfd, sec);
+ unsigned bfd_align = bfd_section_alignment (sec);
bfd_mach_o_section *msect = bfd_mach_o_get_mach_o_section (sec);
mdata->sections[target_index] = msect;
- msect->addr = bfd_get_section_vma (abfd, sec);
- msect->size = bfd_get_section_size (sec);
+ msect->addr = bfd_section_vma (sec);
+ msect->size = bfd_section_size (sec);
/* Use the largest alignment set, in case it was bumped after the
section was created. */
bfd_mach_o_section *s = bfd_mach_o_get_mach_o_section (sec);
/* Create default flags. */
- bfd_flags = bfd_get_section_flags (abfd, sec);
+ bfd_flags = bfd_section_flags (sec);
if ((bfd_flags & SEC_CODE) == SEC_CODE)
s->flags = BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS
| BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS
for (s = seg->sect_head; s != NULL; s = s->next)
{
asection *sec = s->bfdsection;
- flagword flags = bfd_get_section_flags (abfd, sec);
+ flagword flags = bfd_section_flags (sec);
/* Adjust segment size. */
seg->vmsize = FILE_ALIGN (seg->vmsize, s->align);
bfd_mach_o_new_section_hook (bfd *abfd, asection *sec)
{
bfd_mach_o_section *s;
- unsigned bfdalign = bfd_get_section_alignment (abfd, sec);
+ unsigned bfdalign = bfd_section_alignment (sec);
s = bfd_mach_o_get_mach_o_section (sec);
if (s == NULL)
s->flags = xlat->macho_sectype | xlat->macho_secattr;
s->align = xlat->sectalign > bfdalign ? xlat->sectalign
: bfdalign;
- (void) bfd_set_section_alignment (abfd, sec, s->align);
- bfd_flags = bfd_get_section_flags (abfd, sec);
+ bfd_set_section_alignment (sec, s->align);
+ bfd_flags = bfd_section_flags (sec);
if (bfd_flags == SEC_NO_FLAGS)
- bfd_set_section_flags (abfd, sec, xlat->bfd_flags);
+ bfd_set_section_flags (sec, xlat->bfd_flags);
}
else
/* Create default flags. */
}
static void
-bfd_mach_o_init_section_from_mach_o (bfd *abfd, asection *sec,
- unsigned long prot)
+bfd_mach_o_init_section_from_mach_o (asection *sec, unsigned long prot)
{
flagword flags;
bfd_mach_o_section *section;
- flags = bfd_get_section_flags (abfd, sec);
+ flags = bfd_section_flags (sec);
section = bfd_mach_o_get_mach_o_section (sec);
/* TODO: see if we should use the xlat system for doing this by
if (section->nreloc != 0)
flags |= SEC_RELOC;
- bfd_set_section_flags (abfd, sec, flags);
+ bfd_set_section_flags (sec, flags);
sec->vma = section->addr;
sec->lma = section->addr;
section->reserved2 = bfd_h_get_32 (abfd, raw.reserved2);
section->reserved3 = 0;
- bfd_mach_o_init_section_from_mach_o (abfd, sec, prot);
+ bfd_mach_o_init_section_from_mach_o (sec, prot);
return sec;
}
section->reserved2 = bfd_h_get_32 (abfd, raw.reserved2);
section->reserved3 = bfd_h_get_32 (abfd, raw.reserved3);
- bfd_mach_o_init_section_from_mach_o (abfd, sec, prot);
+ bfd_mach_o_init_section_from_mach_o (sec, prot);
return sec;
}
mmo_section_has_contents (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *p ATTRIBUTE_UNUSED)
{
/* The point is to match what --extract-symbols does (well, negated). */
- return bfd_get_section_size (sec) != 0;
+ return bfd_section_size (sec) != 0;
}
/* Find out whether we should omit symbol consistency checks for this
mmo_find_sec_w_addr (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *p)
{
struct mmo_find_sec_info *infop = (struct mmo_find_sec_info *) p;
- bfd_vma vma = bfd_get_section_vma (abfd, sec);
+ bfd_vma vma = bfd_section_vma (sec);
/* Ignore sections that aren't loaded. */
- if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC))
+ if ((bfd_section_flags (sec) & (SEC_LOAD | SEC_ALLOC))
!= (SEC_LOAD | SEC_ALLOC))
return;
mmo_find_sec_w_addr_grow (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *p)
{
struct mmo_find_sec_info *infop = (struct mmo_find_sec_info *) p;
- bfd_vma vma = bfd_get_section_vma (abfd, sec);
+ bfd_vma vma = bfd_section_vma (sec);
/* Ignore sections that aren't loaded. */
- if ((bfd_get_section_flags (abfd, sec) & (SEC_LOAD | SEC_ALLOC))
+ if ((bfd_section_flags (sec) & (SEC_LOAD | SEC_ALLOC))
!= (SEC_LOAD | SEC_ALLOC))
return;
if (sec == NULL)
return NULL;
- if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+ if (!sec->user_set_vma && !bfd_set_section_vma (sec, vma))
return NULL;
- if (! bfd_set_section_flags (abfd, sec,
- bfd_get_section_flags (abfd, sec)
- | SEC_CODE | SEC_LOAD | SEC_ALLOC))
+ if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+ | SEC_CODE | SEC_LOAD | SEC_ALLOC)))
return NULL;
}
else if ((vma >> 56) == 0x20)
if (sec == NULL)
return NULL;
- if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+ if (!sec->user_set_vma && !bfd_set_section_vma (sec, vma))
return NULL;
- if (! bfd_set_section_flags (abfd, sec,
- bfd_get_section_flags (abfd, sec)
- | SEC_LOAD | SEC_ALLOC))
+ if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+ | SEC_LOAD | SEC_ALLOC)))
return NULL;
}
sprintf (sec_name, ".MMIX.sec.%d", abfd->tdata.mmo_data->sec_no++);
sec = mmo_make_section (abfd, sec_name);
- if (! sec->user_set_vma && ! bfd_set_section_vma (abfd, sec, vma))
+ if (!sec->user_set_vma && !bfd_set_section_vma (sec, vma))
return NULL;
- if (! bfd_set_section_flags (abfd, sec,
- bfd_get_section_flags (abfd, sec)
- | SEC_LOAD | SEC_ALLOC))
+ if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+ | SEC_LOAD | SEC_ALLOC)))
return NULL;
return sec;
}
/* Add in the section flags we found to those bfd entered during this
process and set the contents. */
- if (! bfd_set_section_flags (abfd, sec,
- bfd_sec_flags_from_mmo_flags (flags)
- | bfd_get_section_flags (abfd, sec)
- | (section_length != 0 ? SEC_HAS_CONTENTS : 0))
- || ! bfd_set_section_size (abfd, sec, sec->size + section_length)
+ if (!bfd_set_section_flags (sec,
+ (bfd_sec_flags_from_mmo_flags (flags)
+ | bfd_section_flags (sec)
+ | (section_length != 0 ? SEC_HAS_CONTENTS : 0)))
+ || !bfd_set_section_size (sec, sec->size + section_length)
/* Set VMA only for the first occurrence. */
- || (! sec->user_set_vma
- && ! bfd_set_section_vma (abfd, sec, section_vma)))
+ || (!sec->user_set_vma && !bfd_set_section_vma (sec, section_vma)))
{
/* If we get an error for any of the calls above, signal more than
just a format error for the spec section. */
/* We get here for the first time (at other times too) for this
section. Say we have contents. */
- if (! bfd_set_section_flags (sec->owner, sec,
- bfd_get_section_flags (sec->owner, sec)
- | SEC_HAS_CONTENTS))
+ if (!bfd_set_section_flags (sec, (bfd_section_flags (sec)
+ | SEC_HAS_CONTENTS)))
return NULL;
}
}
section flags must be set then. */
sec = bfd_get_section_by_name (abfd, MMO_TEXT_SECTION_NAME);
if (sec != NULL
- && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
- && ! bfd_set_section_flags (abfd, sec,
- bfd_get_section_flags (abfd, sec)
- | SEC_ALLOC | SEC_LOAD | SEC_CODE))
+ && (bfd_section_flags (sec) & SEC_HAS_CONTENTS)
+ && !bfd_set_section_flags (sec, (bfd_section_flags (sec)
+ | SEC_ALLOC | SEC_LOAD | SEC_CODE)))
error = TRUE;
sec = bfd_get_section_by_name (abfd, MMO_DATA_SECTION_NAME);
if (sec != NULL
- && (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
- && ! bfd_set_section_flags (abfd, sec,
- bfd_get_section_flags (abfd, sec)
- | SEC_ALLOC | SEC_LOAD))
+ && (bfd_section_flags (sec) & SEC_HAS_CONTENTS)
+ && !bfd_set_section_flags (sec, (bfd_section_flags (sec)
+ | SEC_ALLOC | SEC_LOAD)))
error = TRUE;
/* Free whatever resources we took. */
static bfd_boolean
mmo_has_leading_or_trailing_zero_tetra_p (bfd *abfd, asection *sec)
{
- bfd_vma secaddr = bfd_get_section_vma (abfd, sec);
+ bfd_vma secaddr = bfd_section_vma (sec);
if (sec->size < 4)
return FALSE;
if (strcmp (sec->name, MMO_TEXT_SECTION_NAME) == 0)
{
- bfd_vma secaddr = bfd_get_section_vma (abfd, sec);
+ bfd_vma secaddr = bfd_section_vma (sec);
/* Because leading and trailing zeros are omitted in output, we need to
specify the section boundaries so they're correct when the file
}
else if (strcmp (sec->name, MMO_DATA_SECTION_NAME) == 0)
{
- bfd_vma secaddr = bfd_get_section_vma (abfd, sec);
+ bfd_vma secaddr = bfd_section_vma (sec);
/* Same goes as for MMO_TEXT_SECTION_NAME above. */
if (sec->size != 0
}
/* Ignore sections that are just allocated or empty; we write out
_contents_ here. */
- else if ((bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) != 0
+ else if ((bfd_section_flags (sec) & SEC_HAS_CONTENTS) != 0
&& sec->size != 0)
{
if (!mmo_write_section_description (abfd, sec))
/* Writing a LOP_LOC ends the LOP_SPEC data, and makes data actually
loaded. */
- if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
+ if (bfd_section_flags (sec) & SEC_LOAD)
return (! abfd->tdata.mmo_data->have_error
&& mmo_write_loc_chunk_list (abfd,
mmo_section_data (sec)->head));
for all alien sections; perhaps mmo.em should clear that flag. Might
be related to weak references. */
mmo_write_tetra (abfd,
- mmo_sec_flags_from_bfd_flags
- (bfd_get_section_flags (abfd, sec)));
+ mmo_sec_flags_from_bfd_flags (bfd_section_flags (sec)));
mmo_write_octa (abfd, sec->size);
- mmo_write_octa (abfd, bfd_get_section_vma (abfd, sec));
+ mmo_write_octa (abfd, bfd_section_vma (sec));
return TRUE;
}
/* Exclude the convenience register section. */
if (strcmp (sec->name, MMIX_REG_SECTION_NAME) == 0)
{
- if (bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS)
+ if (bfd_section_flags (sec) & SEC_HAS_CONTENTS)
{
/* Make sure it hasn't got contents. It seems impossible to
make it carry contents, so we don't have a test-case for
if (sect == NULL)
return NULL;
- size = bfd_get_section_size (sect);
+ size = bfd_section_size (sect);
/* PR 22794: Make sure that the section has a reasonable size. */
if (size < 8 || size >= bfd_get_size (abfd))
if (sect == NULL)
return NULL;
- size = bfd_get_section_size (sect);
+ size = bfd_section_size (sect);
if (size < 8 || size >= bfd_get_size (abfd))
return NULL;
/* BuildID value is stored after the filename. */
name = (char *) contents;
buildid_offset = strnlen (name, size) + 1;
- if (buildid_offset >= bfd_get_section_size (sect))
+ if (buildid_offset >= bfd_section_size (sect))
return NULL;
*buildid_len = size - buildid_offset;
debuglink_size &= ~3;
debuglink_size += 4;
- if (! bfd_set_section_size (abfd, sect, debuglink_size))
+ if (!bfd_set_section_size (sect, debuglink_size))
/* XXX Should we delete the section from the bfd ? */
return NULL;
/* PR 21193: Ensure that the section has 4-byte alignment for the CRC.
Note - despite the name of the function being called, we are
setting an alignment power, not a byte alignment value. */
- bfd_set_section_alignment (abfd, sect, 2);
+ bfd_set_section_alignment (sect, 2);
return sect;
}
return NULL;
}
- size = bfd_get_section_size (sect);
+ size = bfd_section_size (sect);
/* FIXME: Should we support smaller build-id notes ? */
if (size < 0x24)
{
/* FIXME: Paranoia - allow for compressed build-id sections.
Maybe we should complain if this size is different from
the one obtained above... */
- size = bfd_get_section_size (sect);
+ size = bfd_section_size (sect);
if (size < sizeof (Elf_External_Note))
{
bfd_set_error (bfd_error_invalid_operation);
break;
case N_TEXT | N_EXT:
section = obj_textsec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_DATA | N_EXT:
/* Treat N_SETV symbols as N_DATA symbol; see comment in
translate_from_native_sym_flags. */
section = obj_datasec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
case N_BSS | N_EXT:
section = obj_bsssec (abfd);
- value -= bfd_get_section_vma (abfd, section);
+ value -= bfd_section_vma (section);
break;
}
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, NULL,
(p->type == bfd_section_reloc_link_order
- ? bfd_section_name (flaginfo->output_bfd,
- pr->u.section)
+ ? bfd_section_name (pr->u.section)
: pr->u.name),
howto->name, pr->addend, NULL,
(asection *) NULL, (bfd_vma) 0);
asection *s;
s = aout_reloc_type_to_section (input_bfd, r_type);
- name = bfd_section_name (input_bfd, s);
+ name = bfd_section_name (s);
}
(*flaginfo->info->callbacks->reloc_overflow)
(flaginfo->info, (h ? &h->root : NULL), name, howto->name,
return FALSE;
PUT_WORD (output_bfd, strtab_index, outsym->e_strx);
PUT_WORD (output_bfd,
- (bfd_get_section_vma (output_bfd,
- obj_textsec (input_bfd)->output_section)
+ (bfd_section_vma (obj_textsec (input_bfd)->output_section)
+ obj_textsec (input_bfd)->output_offset),
outsym->e_value);
++obj_aout_external_sym_count (output_bfd);
BFD_ASSERT (bfd_is_abs_section (output_section)
|| output_section->owner == output_bfd);
val = (hresolve->root.u.def.value
- + bfd_get_section_vma (output_bfd, output_section)
+ + bfd_section_vma (output_section)
+ input_section->output_offset);
/* Get the correct type based on the section. If
if (PEX64_IS_RUNTIME_FUNCTION_CHAINED (&rf))
{
bfd_vma altent = PEX64_GET_UNWINDDATA_UNIFIED_RVA (&rf);
- bfd_vma pdata_vma = bfd_get_section_vma (abfd, pdata_section);
+ bfd_vma pdata_vma = bfd_section_vma (pdata_section);
struct pex64_runtime_function arf;
fprintf (file, "\t shares information with ");
flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_KEEP | SEC_IN_MEMORY;
- bfd_set_section_flags (vars->abfd, sec, flags | extra_flags);
+ bfd_set_section_flags (sec, flags | extra_flags);
- (void) bfd_set_section_alignment (vars->abfd, sec, 2);
+ bfd_set_section_alignment (sec, 2);
/* Check that we will not run out of space. */
BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size);
/* Set the section size and contents. The actual
contents are filled in by our parent. */
- bfd_set_section_size (vars->abfd, sec, (bfd_size_type) size);
+ bfd_set_section_size (sec, (bfd_size_type) size);
sec->contents = vars->data;
sec->target_index = vars->sec_index ++;
/* For a range list, use 1 instead of 0 as placeholder. 0
would terminate the list, hiding any later entries. */
- if (strcmp (bfd_get_section_name (input_bfd, input_section),
- ".debug_ranges") == 0
+ if (strcmp (bfd_section_name (input_section), ".debug_ranges") == 0
&& (howto->dst_mask & 1) != 0)
x |= 1;
. would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
. compilers will complain about comma expressions that have no effect. *}
.static inline bfd_boolean
-.bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
-. void * val)
+.bfd_set_section_userdata (asection *sec, void *val)
.{
-. ptr->userdata = val;
+. sec->userdata = val;
. return TRUE;
.}
.
.static inline bfd_boolean
-.bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
+.bfd_set_section_vma (asection *sec, bfd_vma val)
.{
-. ptr->vma = ptr->lma = val;
-. ptr->user_set_vma = TRUE;
+. sec->vma = sec->lma = val;
+. sec->user_set_vma = TRUE;
. return TRUE;
.}
.
.static inline bfd_boolean
-.bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr,
-. unsigned int val)
+.bfd_set_section_lma (asection *sec, bfd_vma val)
.{
-. ptr->alignment_power = val;
+. sec->lma = val;
+. return TRUE;
+.}
+.
+.static inline bfd_boolean
+.bfd_set_section_alignment (asection *sec, unsigned int val)
+.{
+. sec->alignment_power = val;
. return TRUE;
.}
.
bfd_set_section_flags
SYNOPSIS
- bfd_boolean bfd_set_section_flags
- (bfd *abfd, asection *sec, flagword flags);
+ bfd_boolean bfd_set_section_flags (asection *sec, flagword flags);
DESCRIPTION
- Set the attributes of the section @var{sec} in the BFD
- @var{abfd} to the value @var{flags}. Return <<TRUE>> on success,
- <<FALSE>> on error. Possible error returns are:
+ Set the attributes of the section @var{sec} to the value @var{flags}.
+ Return <<TRUE>> on success, <<FALSE>> on error. Possible error
+ returns are:
o <<bfd_error_invalid_operation>> -
The section cannot have one or more of the attributes
*/
bfd_boolean
-bfd_set_section_flags (bfd *abfd ATTRIBUTE_UNUSED,
- sec_ptr section,
- flagword flags)
+bfd_set_section_flags (asection *section, flagword flags)
{
section->flags = flags;
return TRUE;
SYNOPSIS
void bfd_rename_section
- (bfd *abfd, asection *sec, const char *newname);
+ (asection *sec, const char *newname);
DESCRIPTION
- Rename section @var{sec} in @var{abfd} to @var{newname}.
+ Rename section @var{sec} to @var{newname}.
*/
void
-bfd_rename_section (bfd *abfd, sec_ptr sec, const char *newname)
+bfd_rename_section (asection *sec, const char *newname)
{
struct section_hash_entry *sh;
sh = (struct section_hash_entry *)
((char *) sec - offsetof (struct section_hash_entry, section));
sh->section.name = newname;
- bfd_hash_rename (&abfd->section_htab, newname, &sh->root);
+ bfd_hash_rename (&sec->owner->section_htab, newname, &sh->root);
}
/*
bfd_set_section_size
SYNOPSIS
- bfd_boolean bfd_set_section_size
- (bfd *abfd, asection *sec, bfd_size_type val);
+ bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val);
DESCRIPTION
Set @var{sec} to the size @var{val}. If the operation is
*/
bfd_boolean
-bfd_set_section_size (bfd *abfd, sec_ptr ptr, bfd_size_type val)
+bfd_set_section_size (asection *sec, bfd_size_type val)
{
/* Once you've started writing to any section you cannot create or change
the size of any others. */
- if (abfd->output_has_begun)
+ if (sec->owner == NULL || sec->owner->output_has_begun)
{
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
- ptr->size = val;
+ sec->size = val;
return TRUE;
}
{
bfd_size_type sz;
- if (!(bfd_get_section_flags (abfd, section) & SEC_HAS_CONTENTS))
+ if (!(bfd_section_flags (section) & SEC_HAS_CONTENTS))
{
bfd_set_error (bfd_error_no_contents);
return FALSE;
/* We are passed a section relative offset. The offsets in the
stabs information are absolute. */
- offset += bfd_get_section_vma (abfd, section);
+ offset += bfd_section_vma (section);
#ifdef ENABLE_CACHING
if (info->cached_indexentry != NULL
section->size = size;
section->vma = vaddr;
- if (!bfd_set_section_flags (abfd, section, bfd_flags))
+ if (!bfd_set_section_flags (section, bfd_flags))
return FALSE;
}
section->size = dstsize;
section->filepos = VMS_BLOCK_SIZE * (dstvbn - 1);
- if (!bfd_set_section_flags (abfd, section, bfd_flags))
+ if (!bfd_set_section_flags (section, bfd_flags))
return FALSE;
PRIV (dst_section) = section;
section->size = dmtbytes;
section->filepos = VMS_BLOCK_SIZE * (dmtvbn - 1);
- if (!bfd_set_section_flags (abfd, section, bfd_flags))
+ if (!bfd_set_section_flags (section, bfd_flags))
return FALSE;
}
new_flags |= SEC_CODE;
new_flags &= ~SEC_DATA;
}
- if (!bfd_set_section_flags (abfd, section, new_flags))
+ if (!bfd_set_section_flags (section, new_flags))
return FALSE;
/* Give a non-overlapping vma to non absolute sections. */
section = bfd_make_section (abfd, "$DST$");
if (!section)
return FALSE;
- if (!bfd_set_section_flags (abfd, section, flags))
+ if (!bfd_set_section_flags (section, flags))
return FALSE;
PRIV (dst_section) = section;
}
section and build the list of modules. This is sufficient
since we can compute the start address and the end address
of every module from the section contents. */
- bfd_size_type size = bfd_get_section_size (dmt);
+ bfd_size_type size = bfd_section_size (dmt);
unsigned char *ptr, *end;
ptr = (unsigned char *) bfd_alloc (abfd, size);
vms_debug2 ((1, "vms_new_section_hook (%p, [%u]%s)\n",
abfd, section->index, section->name));
- if (! bfd_set_section_alignment (abfd, section, 0))
+ if (!bfd_set_section_alignment (section, 0))
return FALSE;
vms_debug2 ((7, "%u: %s\n", section->index, section->name));
else if (bfd_is_ind_section (sec))
ret->type = 'I';
else if ((symbol->flags & BSF_FUNCTION)
- || (bfd_get_section_flags (abfd, sec) & SEC_CODE))
+ || (bfd_section_flags (sec) & SEC_CODE))
ret->type = 'T';
- else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
+ else if (bfd_section_flags (sec) & SEC_DATA)
ret->type = 'D';
- else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
+ else if (bfd_section_flags (sec) & SEC_ALLOC)
ret->type = 'B';
else
ret->type = '?';
for (o = abfd->sections; o != first_csect; o = o->next)
{
/* Debugging sections have no csects. */
- if (bfd_get_section_flags (abfd, o) & SEC_DEBUGGING)
+ if (bfd_section_flags (o) & SEC_DEBUGGING)
continue;
/* Reset the section size and the line number count, since the
data is now attached to the csects. Don't reset the size of
the .debug section, since we need to read it below in
bfd_xcoff_size_dynamic_sections. */
- if (strcmp (bfd_get_section_name (abfd, o), ".debug") != 0)
+ if (strcmp (bfd_section_name (o), ".debug") != 0)
o->size = 0;
o->lineno_count = 0;
|| o == xcoff_hash_table (info)->loader_section
|| o == xcoff_hash_table (info)->linkage_section
|| o == xcoff_hash_table (info)->descriptor_section
- || (bfd_get_section_flags (sub, o) & SEC_DEBUGGING)
+ || (bfd_section_flags (o) & SEC_DEBUGGING)
|| strcmp (o->name, ".debug") == 0)
o->flags |= SEC_MARK;
else
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * addr2line.c, * bucomm.c, * coffgrok.c, * dlltool.c, * nm.c,
+ * objcopy.c, * objdump.c, * od-elf32_avr.c, * od-macho.c,
+ * od-xcoff.c, * prdbg.c, * rdcoff.c, * rddbg.c, * rescoff.c,
+ * resres.c, * size.c, * srconv.c, * strings.c, * windmc.c: Update
+ throughout for bfd section macro and function changes.
+
2019-09-18 Alan Modra <amodra@gmail.com>
* nm.c: Update bfd_get_section to bfd_asymbol_section throughout.
if (found)
return;
- if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
return;
- vma = bfd_get_section_vma (abfd, section);
+ vma = bfd_section_vma (section);
if (pc < vma)
return;
- size = bfd_get_section_size (section);
+ size = bfd_section_size (section);
if (pc >= vma + size)
return;
if (found)
return;
- if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
return;
- size = bfd_get_section_size (section);
+ size = bfd_section_size (section);
if (pc >= size)
return;
if (!filename)
filename = bfd_get_archive_filename (abfd);
if (section)
- section_name = bfd_get_section_name (abfd, section);
+ section_name = bfd_section_name (section);
}
if (section_name)
fprintf (stderr, ":%s[%s]", filename, section_name);
if (strcmp (section->name, ".bss") == 0)
head->sections[i].data = 1;
head->sections[i].address = section->lma;
- head->sections[i].size = bfd_get_section_size (section);
+ head->sections[i].size = bfd_section_size (section);
head->sections[i].number = idx;
head->sections[i].nrelocs = section->reloc_count;
head->sections[i].relocs =
if (s == NULL)
return;
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
buf = xmalloc (size);
bfd_get_section_contents (abfd, s, buf, 0, size);
if (si->id != i)
abort ();
si->sec = bfd_make_section_old_way (abfd, si->name);
- bfd_set_section_flags (abfd,
- si->sec,
- si->flags & applicable);
+ bfd_set_section_flags (si->sec, si->flags & applicable);
- bfd_set_section_alignment(abfd, si->sec, si->align);
+ bfd_set_section_alignment (si->sec, si->align);
si->sec->output_section = si->sec;
si->sym = bfd_make_empty_symbol(abfd);
si->sym->name = si->sec->name;
arelent *imglue, *ba_rel, *ea_rel, *pea_rel;
/* Alignment must be set to 2**2 or you get extra stuff. */
- bfd_set_section_alignment(abfd, sec, 2);
+ bfd_set_section_alignment (sec, 2);
si->size = 4 * 5;
si->data = xmalloc (si->size);
{
sinfo *si = secdata + i;
- bfd_set_section_size (abfd, si->sec, si->size);
- bfd_set_section_vma (abfd, si->sec, vma);
+ bfd_set_section_size (si->sec, si->size);
+ bfd_set_section_vma (si->sec, vma);
}
}
/* Write them out. */
if (ms_style && ((section->flags & SEC_DATA) == 0))
return;
- if ((datasize = bfd_section_size (abfd, section)) == 0)
+ if ((datasize = bfd_section_size (section)) == 0)
return;
data = (bfd_byte *) xmalloc (datasize + 1);
&& sec == bfd_asymbol_section (next))
sz = valueof (next) - valueof (sym);
else
- sz = (bfd_get_section_vma (abfd, sec)
- + bfd_section_size (abfd, sec)
+ sz = (bfd_section_vma (sec)
+ + bfd_section_size (sec)
- valueof (sym));
}
static bfd_boolean
is_dwo_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec)
{
- const char *name = bfd_get_section_name (abfd, sec);
+ const char *name = bfd_section_name (sec);
int len = strlen (name);
return strncmp (name + len - 4, ".dwo", 4) == 0;
struct section_list *p;
struct section_list *q;
- p = find_section_list (bfd_get_section_name (abfd, sec), FALSE,
+ p = find_section_list (bfd_section_name (sec), FALSE,
SECTION_CONTEXT_REMOVE);
- q = find_section_list (bfd_get_section_name (abfd, sec), FALSE,
+ q = find_section_list (bfd_section_name (sec), FALSE,
SECTION_CONTEXT_COPY);
if (p && q)
fatal (_("error: section %s matches both remove and copy options"),
- bfd_get_section_name (abfd, sec));
+ bfd_section_name (sec));
if (p && is_update_section (abfd, sec))
fatal (_("error: section %s matches both update and remove options"),
- bfd_get_section_name (abfd, sec));
+ bfd_section_name (sec));
if (p != NULL)
return TRUE;
return TRUE;
}
- if ((bfd_get_section_flags (abfd, sec) & SEC_DEBUGGING) != 0)
+ if ((bfd_section_flags (sec) & SEC_DEBUGGING) != 0)
{
if (strip_symbols == STRIP_DEBUG
|| strip_symbols == STRIP_UNNEEDED
/* By default we don't want to strip .reloc section.
This section has for pe-coff special meaning. See
pe-dll.c file in ld, and peXXigen.c in bfd for details. */
- if (strcmp (bfd_get_section_name (abfd, sec), ".reloc") != 0)
+ if (strcmp (bfd_section_name (sec), ".reloc") != 0)
return TRUE;
}
if (is_strip_section_1 (abfd, sec))
return TRUE;
- if ((bfd_get_section_flags (abfd, sec) & SEC_GROUP) != 0)
+ if ((bfd_section_flags (sec) & SEC_GROUP) != 0)
{
asymbol *gsym;
const char *gname;
directory", but that may be the .text section for objects produced by some
tools, which it is not sensible to keep. */
if (ibfd->xvec->flavour == bfd_target_coff_flavour)
- return (strcmp (bfd_get_section_name (ibfd, isection), ".buildid") == 0);
+ return (strcmp (bfd_section_name (isection), ".buildid") == 0);
return FALSE;
}
}
}
- if (! bfd_set_section_size (obfd, padd->section, padd->size))
+ if (!bfd_set_section_size (padd->section, padd->size))
{
bfd_nonfatal_message (NULL, obfd, padd->section, NULL);
return FALSE;
pset = find_section_list (padd->name, FALSE,
SECTION_CONTEXT_SET_VMA | SECTION_CONTEXT_ALTER_VMA);
if (pset != NULL
- && ! bfd_set_section_vma (obfd, padd->section, pset->vma_val))
+ && !bfd_set_section_vma (padd->section, pset->vma_val))
{
bfd_nonfatal_message (NULL, obfd, padd->section, NULL);
return FALSE;
{
padd->section->lma = pset->lma_val;
- if (! bfd_set_section_alignment
- (obfd, padd->section,
- bfd_section_alignment (obfd, padd->section)))
+ if (!bfd_set_section_alignment
+ (padd->section, bfd_section_alignment (padd->section)))
{
bfd_nonfatal_message (NULL, obfd, padd->section, NULL);
return FALSE;
}
osec = pupdate->section->output_section;
- if (! bfd_set_section_size (obfd, osec, pupdate->size))
+ if (!bfd_set_section_size (osec, pupdate->size))
{
bfd_nonfatal_message (NULL, obfd, osec, NULL);
return FALSE;
{
bfd_size_type size;
- size = bfd_get_section_size (osec);
+ size = bfd_section_size (osec);
if (size == 0)
{
bfd_nonfatal_message (NULL, ibfd, osec, _("warning: note section is empty"));
else
{
if (osec->output_section == NULL
- || ! bfd_set_section_size (obfd, osec->output_section, merged_size))
+ || !bfd_set_section_size (osec->output_section,
+ merged_size))
{
bfd_nonfatal_message (NULL, obfd, osec, _("warning: failed to set merged notes size"));
free (merged_notes);
continue;
}
- if ((bfd_get_section_flags (ibfd, osec) & SEC_HAS_CONTENTS) == 0)
+ if ((bfd_section_flags (osec) & SEC_HAS_CONTENTS) == 0)
{
bfd_nonfatal_message (NULL, ibfd, osec,
_("can't dump section - it has no contents"));
continue;
}
- bfd_size_type size = bfd_get_section_size (osec);
+ bfd_size_type size = bfd_section_size (osec);
if (size == 0)
{
bfd_nonfatal_message (NULL, ibfd, osec,
+ highest_section->size,
/* FIXME: We ought to be using
COFF_PAGE_SIZE here or maybe
- bfd_get_section_alignment() (if it
+ bfd_section_alignment() (if it
was set) but since this is for PE
and we know the required alignment
it is easier just to hard code it. */
/* Umm, not sure what to do in this case. */
debuglink_vma = 0x1000;
- bfd_set_section_vma (obfd, gnu_debuglink_section, debuglink_vma);
+ bfd_set_section_vma (gnu_debuglink_section, debuglink_vma);
}
}
}
bfd_size_type size;
bfd_vma gap_start, gap_stop;
- flags = bfd_get_section_flags (obfd, osections[i]);
+ flags = bfd_section_flags (osections[i]);
if ((flags & SEC_HAS_CONTENTS) == 0
|| (flags & SEC_LOAD) == 0)
continue;
- size = bfd_section_size (obfd, osections[i]);
- gap_start = bfd_section_lma (obfd, osections[i]) + size;
- gap_stop = bfd_section_lma (obfd, osections[i + 1]);
+ size = bfd_section_size (osections[i]);
+ gap_start = bfd_section_lma (osections[i]) + size;
+ gap_stop = bfd_section_lma (osections[i + 1]);
if (gap_start < gap_stop)
{
- if (! bfd_set_section_size (obfd, osections[i],
- size + (gap_stop - gap_start)))
+ if (!bfd_set_section_size (osections[i],
+ size + (gap_stop - gap_start)))
{
bfd_nonfatal_message (NULL, obfd, osections[i],
_("Can't fill gap after section"));
bfd_vma lma;
bfd_size_type size;
- lma = bfd_section_lma (obfd, osections[c - 1]);
- size = bfd_section_size (obfd, osections[c - 1]);
+ lma = bfd_section_lma (osections[c - 1]);
+ size = bfd_section_size (osections[c - 1]);
if (lma + size < pad_to)
{
- if (! bfd_set_section_size (obfd, osections[c - 1],
- pad_to - lma))
+ if (!bfd_set_section_size (osections[c - 1], pad_to - lma))
{
bfd_nonfatal_message (NULL, obfd, osections[c - 1],
_("can't add padding"));
file_ptr off;
left = gaps[i];
- off = bfd_section_size (obfd, osections[i]) - left;
+ off = bfd_section_size (osections[i]) - left;
while (left > 0)
{
return;
/* Get the, possibly new, name of the output section. */
- name = bfd_section_name (ibfd, isection);
- flags = bfd_get_section_flags (ibfd, isection);
+ name = bfd_section_name (isection);
+ flags = bfd_section_flags (isection);
name = find_section_rename (name, &flags);
/* Prefix sections. */
if ((prefix_alloc_sections_string)
- && (bfd_get_section_flags (ibfd, isection) & SEC_ALLOC))
+ && (bfd_section_flags (isection) & SEC_ALLOC))
prefix = prefix_alloc_sections_string;
else if (prefix_sections_string)
prefix = prefix_sections_string;
make_nobits = FALSE;
- p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+ p = find_section_list (bfd_section_name (isection), FALSE,
SECTION_CONTEXT_SET_FLAGS);
if (p != NULL)
flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC));
if (make_nobits)
elf_section_type (osection) = SHT_NOBITS;
- size = bfd_section_size (ibfd, isection);
+ size = bfd_section_size (isection);
size = bfd_convert_section_size (ibfd, isection, obfd, size);
if (copy_byte >= 0)
size = (size + interleave - 1) / interleave * copy_width;
else if (extract_symbol)
size = 0;
- if (! bfd_set_section_size (obfd, osection, size))
+ if (!bfd_set_section_size (osection, size))
{
err = _("failed to set size");
goto loser;
}
- vma = bfd_section_vma (ibfd, isection);
- p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+ vma = bfd_section_vma (isection);
+ p = find_section_list (bfd_section_name (isection), FALSE,
SECTION_CONTEXT_ALTER_VMA | SECTION_CONTEXT_SET_VMA);
if (p != NULL)
{
else
vma += change_section_address;
- if (! bfd_set_section_vma (obfd, osection, vma))
+ if (!bfd_set_section_vma (osection, vma))
{
err = _("failed to set vma");
goto loser;
}
lma = isection->lma;
- p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+ p = find_section_list (bfd_section_name (isection), FALSE,
SECTION_CONTEXT_ALTER_LMA | SECTION_CONTEXT_SET_LMA);
if (p != NULL)
{
osection->lma = lma;
- p = find_section_list (bfd_section_name (ibfd, isection), FALSE,
+ p = find_section_list (bfd_section_name (isection), FALSE,
SECTION_CONTEXT_SET_ALIGNMENT);
if (p != NULL)
alignment = p->alignment;
else
- alignment = bfd_section_alignment (ibfd, isection);
+ alignment = bfd_section_alignment (isection);
/* FIXME: This is probably not enough. If we change the LMA we
may have to recompute the header for the file as well. */
- if (!bfd_set_section_alignment (obfd,
- osection,
- alignment))
+ if (!bfd_set_section_alignment (osection, alignment))
{
err = _("failed to set alignment");
goto loser;
if (skip_copy && is_merged_note_section (ibfd, isection))
return TRUE;
- flags = bfd_get_section_flags (ibfd, isection);
+ flags = bfd_section_flags (isection);
if ((flags & SEC_GROUP) != 0)
return TRUE;
osection = isection->output_section;
- size = bfd_get_section_size (isection);
+ size = bfd_section_size (isection);
if (size == 0 || osection == 0)
return TRUE;
static bfd_boolean
discard_relocations (bfd *ibfd ATTRIBUTE_UNUSED, asection *isection)
{
- return (find_section_list (bfd_section_name (ibfd, isection), FALSE,
+ return (find_section_list (bfd_section_name (isection), FALSE,
SECTION_CONTEXT_REMOVE_RELOCS) != NULL);
}
ELF classes of input and output aren't the same. We can't use
the output section size since --interleave will shrink the output
section. Size will be updated if the section is converted. */
- size = bfd_get_section_size (isection);
+ size = bfd_section_size (isection);
- if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS
- && bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS)
+ if (bfd_section_flags (isection) & SEC_HAS_CONTENTS
+ && bfd_section_flags (osection) & SEC_HAS_CONTENTS)
{
bfd_byte *memhunk = NULL;
else
/* User must pad the section up in order to do this. */
fatal (_("cannot reverse bytes: length of section %s must be evenly divisible by %d"),
- bfd_section_name (ibfd, isection), reverse_bytes);
+ bfd_section_name (isection), reverse_bytes);
}
if (copy_byte >= 0)
}
free (memhunk);
}
- else if ((p = find_section_list (bfd_get_section_name (ibfd, isection),
+ else if ((p = find_section_list (bfd_section_name (isection),
FALSE, SECTION_CONTEXT_SET_FLAGS)) != NULL
&& (p->flags & SEC_HAS_CONTENTS) != 0)
{
return -1;
/* Sort sections with the same LMA by size. */
- if (bfd_get_section_size (*sec1) > bfd_get_section_size (*sec2))
+ if (bfd_section_size (*sec1) > bfd_section_size (*sec2))
return 1;
- else if (bfd_get_section_size (*sec1) < bfd_get_section_size (*sec2))
+ else if (bfd_section_size (*sec1) < bfd_section_size (*sec2))
return -1;
return 0;
stabstrsec = bfd_make_section_with_flags (obfd, ".stabstr", flags);
if (stabsec == NULL
|| stabstrsec == NULL
- || ! bfd_set_section_size (obfd, stabsec, symsize)
- || ! bfd_set_section_size (obfd, stabstrsec, stringsize)
- || ! bfd_set_section_alignment (obfd, stabsec, 2)
- || ! bfd_set_section_alignment (obfd, stabstrsec, 0))
+ || !bfd_set_section_size (stabsec, symsize)
+ || !bfd_set_section_size (stabstrsec, stringsize)
+ || !bfd_set_section_alignment (stabsec, 2)
+ || !bfd_set_section_alignment (stabstrsec, 0))
{
bfd_nonfatal_message (NULL, obfd, NULL,
_("can't create debugging section"));
return;
printf ("%3d %-*s %08lx ", section->index, longest_section_name,
- sanitize_string (bfd_get_section_name (abfd, section)),
- (unsigned long) bfd_section_size (abfd, section) / opb);
- bfd_printf_vma (abfd, bfd_get_section_vma (abfd, section));
+ sanitize_string (bfd_section_name (section)),
+ (unsigned long) bfd_section_size (section) / opb);
+ bfd_printf_vma (abfd, bfd_section_vma (section));
printf (" ");
bfd_printf_vma (abfd, section->lma);
printf (" %08lx 2**%u", (unsigned long) section->filepos,
- bfd_get_section_alignment (abfd, section));
+ bfd_section_alignment (section));
if (! wide_output)
printf ("\n ");
printf (" ");
DATA which contains the string length of the longest section name. */
static void
-find_longest_section_name (bfd *abfd, asection *section, void *data)
+find_longest_section_name (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *section, void *data)
{
int *longest_so_far = (int *) data;
const char *name;
if (! process_section_p (section))
return;
- name = bfd_get_section_name (abfd, section);
+ name = bfd_section_name (section);
len = (int) strlen (name);
if (len > *longest_so_far)
*longest_so_far = len;
debug info file, whilst the section we want is in a normal file.
So the section pointers will be different, but the section names
will be the same. */
- if (strcmp (bfd_section_name (abfd, sorted_syms[place]->section),
- bfd_section_name (abfd, sec)) != 0)
+ if (strcmp (bfd_section_name (sorted_syms[place]->section),
+ bfd_section_name (sec)) != 0)
return FALSE;
}
Also give the target a chance to reject symbols. */
want_section = (aux->require_sec
|| ((abfd->flags & HAS_RELOC) != 0
- && vma >= bfd_get_section_vma (abfd, sec)
- && vma < (bfd_get_section_vma (abfd, sec)
- + bfd_section_size (abfd, sec) / opb)));
+ && vma >= bfd_section_vma (sec)
+ && vma < (bfd_section_vma (sec)
+ + bfd_section_size (sec) / opb)));
if (! sym_ok (want_section, abfd, thisplace, sec, inf))
{
bfd_vma secaddr;
(*inf->fprintf_func) (inf->stream, " <%s",
- sanitize_string (bfd_get_section_name (abfd, sec)));
- secaddr = bfd_get_section_vma (abfd, sec);
+ sanitize_string (bfd_section_name (sec)));
+ secaddr = bfd_section_vma (sec);
if (vma < secaddr)
{
(*inf->fprintf_func) (inf->stream, "-0x");
asection *sym_sec;
sym_sec = bfd_asymbol_section (*q->sym_ptr_ptr);
- sym_name = bfd_get_section_name (aux->abfd, sym_sec);
+ sym_name = bfd_section_name (sym_sec);
if (sym_name == NULL || *sym_name == '\0')
sym_name = "*unknown*";
printf ("%s", sanitize_string (sym_name));
if (! process_section_p (section))
return;
- datasize = bfd_get_section_size (section);
+ datasize = bfd_section_size (section);
if (datasize == 0)
return;
else
{
#define is_valid_next_sym(SYM) \
- (strcmp (bfd_section_name (abfd, (SYM)->section), bfd_section_name (abfd, section)) == 0 \
+ (strcmp (bfd_section_name ((SYM)->section), bfd_section_name (section)) == 0 \
&& (bfd_asymbol_value (SYM) > bfd_asymbol_value (sym)) \
&& pinfo->symbol_is_valid (SYM, pinfo))
section->filename = bfd_get_filename (abfd);
section->reloc_info = NULL;
section->num_relocs = 0;
- section->address = bfd_get_section_vma (abfd, sec);
+ section->address = bfd_section_vma (sec);
section->user_data = sec;
- section->size = bfd_get_section_size (sec);
+ section->size = bfd_section_size (sec);
/* PR 24360: On 32-bit hosts sizeof (size_t) < sizeof (bfd_size_type). */
alloced = amt = section->size + 1;
if (alloced != amt || alloced == 0)
dump_dwarf_section (bfd *abfd, asection *section,
void *arg ATTRIBUTE_UNUSED)
{
- const char *name = bfd_get_section_name (abfd, section);
+ const char *name = bfd_section_name (section);
const char *match;
int i;
return NULL;
}
- *size_ptr = bfd_section_size (abfd, stabsect);
+ *size_ptr = bfd_section_size (stabsect);
if (entsize_ptr)
*entsize_ptr = stabsect->entsize;
if (! process_section_p (section))
return;
- if ((datasize = bfd_section_size (abfd, section)) == 0)
+ if ((datasize = bfd_section_size (section)) == 0)
return;
/* Compute the address range to display. */
if ((section = bfd_get_section_by_name (abfd, ".note.gnu.avr.deviceinfo")) == NULL)
return NULL;
- *size = bfd_get_section_size (section);
+ *size = bfd_section_size (section);
char *contents = (char *) xmalloc (*size);
bfd_get_section_contents (abfd, section, contents, 0, *size);
asection *section;
if ((section = bfd_get_section_by_name (abfd, ".data")) != NULL)
- avr_datasize = bfd_section_size (abfd, section);
+ avr_datasize = bfd_section_size (section);
if ((section = bfd_get_section_by_name (abfd, ".text")) != NULL)
- avr_textsize = bfd_section_size (abfd, section);
+ avr_textsize = bfd_section_size (section);
if ((section = bfd_get_section_by_name (abfd, ".bss")) != NULL)
- avr_bsssize = bfd_section_size (abfd, section);
+ avr_bsssize = bfd_section_size (section);
if ((section = bfd_get_section_by_name (abfd, ".bootloader")) != NULL)
- bootloadersize = bfd_section_size (abfd, section);
+ bootloadersize = bfd_section_size (section);
if ((section = bfd_get_section_by_name (abfd, ".noinit")) != NULL)
- noinitsize = bfd_section_size (abfd, section);
+ noinitsize = bfd_section_size (section);
if ((section = bfd_get_section_by_name (abfd, ".eeprom")) != NULL)
- eepromsize = bfd_section_size (abfd, section);
+ eepromsize = bfd_section_size (section);
*text_usage = avr_textsize + avr_datasize + bootloadersize;
*data_usage = avr_datasize + avr_bsssize + noinitsize;
for (i = 0; i < r_list->record_count; ++i)
{
printf (" %d %s @ %s + %#08lx (%#08lx)\n",
- i,
- avr_elf32_property_record_name (&r_list->records [i]),
- r_list->records [i].section->name,
- r_list->records [i].offset,
- (bfd_get_section_vma (abfd, r_list->records [i].section)
- + r_list->records [i].offset));
+ i,
+ avr_elf32_property_record_name (&r_list->records [i]),
+ r_list->records [i].section->name,
+ r_list->records [i].offset,
+ (bfd_section_vma (r_list->records [i].section)
+ + r_list->records [i].offset));
switch (r_list->records [i].type)
{
case RECORD_ORG:
asection *bfdsec = sec->bfdsection;
unsigned char *content;
- size = bfd_get_section_size (bfdsec);
+ size = bfd_section_size (bfdsec);
content = (unsigned char *) xmalloc (size);
bfd_get_section_contents (abfd, bfdsec, content, 0, size);
{
bfd_size_type size;
- size = bfd_get_section_size (debugsec);
+ size = bfd_section_size (debugsec);
debug = (char *) xmalloc (size);
bfd_get_section_contents (abfd, debugsec, debug, 0, size);
}
printf (_("no .loader section in file\n"));
return;
}
- size = bfd_get_section_size (loader);
+ size = bfd_section_size (loader);
if (size < sizeof (*lhdr))
{
printf (_("section .loader is too short\n"));
printf (_("no .except section in file\n"));
return;
}
- size = bfd_get_section_size (sec);
+ size = bfd_section_size (sec);
excp_data = (bfd_byte *) xmalloc (size);
bfd_get_section_contents (abfd, sec, excp_data, 0, size);
exceptab = (struct external_exceptab *)excp_data;
printf (_("no .typchk section in file\n"));
return;
}
- size = bfd_get_section_size (sec);
+ size = bfd_section_size (sec);
data = (bfd_byte *) xmalloc (size);
bfd_get_section_contents (abfd, sec, data, 0, size);
text_sec = bfd_get_section_by_name (abfd, ".text");
if (text_sec == NULL)
return;
- text_vma = bfd_get_section_vma (abfd, text_sec);
+ text_vma = bfd_section_vma (text_sec);
- text_size = bfd_get_section_size (text_sec);
+ text_size = bfd_section_size (text_sec);
text = (char *) xmalloc (text_size);
bfd_get_section_contents (abfd, text_sec, text, 0, text_size);
if (found)
return;
- if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
return;
- vma = bfd_get_section_vma (abfd, section);
+ vma = bfd_section_vma (section);
if (pc < vma)
return;
- size = bfd_get_section_size (section);
+ size = bfd_section_size (section);
if (pc >= vma + size)
return;
else
base = auxent.x_sym.x_misc.x_lnsz.x_lnno - 1;
- addr = bfd_get_section_vma (abfd, bfd_asymbol_section (sym));
+ addr = bfd_section_vma (bfd_asymbol_section (sym));
++linenos;
bfd_byte *stab;
bfd_size_type stroff, next_stroff;
- stabsize = bfd_section_size (abfd, sec);
+ stabsize = bfd_section_size (sec);
stabs = (bfd_byte *) xmalloc (stabsize);
if (! bfd_get_section_contents (abfd, sec, stabs, 0, stabsize))
{
return FALSE;
}
- strsize = bfd_section_size (abfd, strsec);
+ strsize = bfd_section_size (strsec);
strings = (bfd_byte *) xmalloc (strsize + 1);
if (! bfd_get_section_contents (abfd, strsec, strings, 0, strsize))
{
}
set_windres_bfd (&wrbfd, abfd, sec, WR_KIND_BFD);
- size = bfd_section_size (abfd, sec);
+ size = bfd_section_size (sec);
/* PR 17512: file: 1b25ba5d
The call to get_file_size here may be expensive
but there is no other way to determine if the section size
flaginfo.filename = filename;
flaginfo.data = data;
flaginfo.data_end = data + size;
- flaginfo.secaddr = (bfd_get_section_vma (abfd, sec)
- - pe_data (abfd)->pe_opthdr.ImageBase);
+ flaginfo.secaddr = (bfd_section_vma (sec)
+ - pe_data (abfd)->pe_opthdr.ImageBase);
/* Now just read in the top level resource directory. Note that we
don't free data, since we create resource entries that point into
+ cwi.dataentsize
+ cwi.resources.length);
- if (! bfd_set_section_size (abfd, sec, length))
+ if (!bfd_set_section_size (sec, length))
bfd_fatal ("bfd_set_section_size");
bfd_set_reloc (abfd, sec, cwi.relocs, cwi.reloc_count);
sec_length = write_res_directory ((windres_bfd *) NULL, 0x20UL, resdir,
(const rc_res_id *) NULL,
(const rc_res_id *) NULL, &language, 1);
- if (! bfd_set_section_size (abfd, sec, (sec_length + 3) & ~3))
+ if (!bfd_set_section_size (sec, (sec_length + 3) & ~3))
bfd_fatal ("bfd_set_section_size");
if ((sec_length & 3) != 0)
set_windres_bfd_content (&wrbfd, sign, sec_length, 4-(sec_length & 3));
flagword flags;
bfd_size_type size;
- flags = bfd_get_section_flags (abfd, sec);
+ flags = bfd_section_flags (sec);
if ((flags & SEC_ALLOC) == 0)
return;
- size = bfd_get_section_size (sec);
+ size = bfd_section_size (sec);
if ((flags & SEC_CODE) != 0
|| (selected_output_format == FORMAT_BERKLEY
&& (flags & SEC_READONLY) != 0))
sysv_internal_sizer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
void *ignore ATTRIBUTE_UNUSED)
{
- bfd_size_type size = bfd_section_size (file, sec);
+ bfd_size_type size = bfd_section_size (sec);
if ( ! bfd_is_abs_section (sec)
&& ! bfd_is_com_section (sec)
&& ! bfd_is_und_section (sec))
{
- int namelen = strlen (bfd_section_name (file, sec));
+ int namelen = strlen (bfd_section_name (sec));
if (namelen > svi_namelen)
svi_namelen = namelen;
svi_total += size;
- if (bfd_section_vma (file, sec) > svi_maxvma)
- svi_maxvma = bfd_section_vma (file, sec);
+ if (bfd_section_vma (sec) > svi_maxvma)
+ svi_maxvma = bfd_section_vma (sec);
}
}
sysv_internal_printer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
void *ignore ATTRIBUTE_UNUSED)
{
- bfd_size_type size = bfd_section_size (file, sec);
+ bfd_size_type size = bfd_section_size (sec);
if ( ! bfd_is_abs_section (sec)
&& ! bfd_is_com_section (sec)
{
svi_total += size;
- sysv_one_line (bfd_section_name (file, sec),
+ sysv_one_line (bfd_section_name (sec),
size,
- bfd_section_vma (file, sec));
+ bfd_section_vma (sec));
}
}
unsigned char stuff[200];
i = 0;
- while (i < bfd_get_section_size (section->bfd_section))
+ while (i < bfd_section_size (section->bfd_section))
{
struct IT_ob ob;
int todo = 200; /* Copy in 200 byte lumps. */
ob.spare = 0;
- if (i + todo > bfd_get_section_size (section->bfd_section))
- todo = bfd_get_section_size (section->bfd_section) - i;
+ if (i + todo > bfd_section_size (section->bfd_section))
+ todo = bfd_section_size (section->bfd_section) - i;
if (first)
{
if ((sect->flags & DATA_FLAGS) != DATA_FLAGS)
return;
- sectsize = bfd_get_section_size (sect);
+ sectsize = bfd_section_size (sect);
if (sectsize == 0)
return;
dta_off += mi[i].res_len;
}
sec_length = (dta_off + 3) & ~3;
- if (! bfd_set_section_size (mc_bfd.abfd, mc_bfd.sec, sec_length))
+ if (!bfd_set_section_size (mc_bfd.sec, sec_length))
bfd_fatal ("bfd_set_section_size");
/* Make sure we write the complete block. */
set_windmc_bfd_content ("\0", sec_length - 1, 1);
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * as.c, * as.h, * dw2gencfi.c, * dwarf2dbg.c, * ecoff.c,
+ * read.c, * stabs.c, * subsegs.c, * subsegs.h, * write.c,
+ * config/obj-coff-seh.c, * config/obj-coff.c, * config/obj-ecoff.c,
+ * config/obj-elf.c, * config/obj-macho.c, * config/obj-som.c,
+ * config/tc-aarch64.c, * config/tc-alpha.c, * config/tc-arc.c,
+ * config/tc-arm.c, * config/tc-avr.c, * config/tc-bfin.c,
+ * config/tc-bpf.c, * config/tc-d10v.c, * config/tc-d30v.c,
+ * config/tc-epiphany.c, * config/tc-fr30.c, * config/tc-frv.c,
+ * config/tc-h8300.c, * config/tc-hppa.c, * config/tc-i386.c,
+ * config/tc-ia64.c, * config/tc-ip2k.c, * config/tc-iq2000.c,
+ * config/tc-lm32.c, * config/tc-m32c.c, * config/tc-m32r.c,
+ * config/tc-m68hc11.c, * config/tc-mep.c, * config/tc-microblaze.c,
+ * config/tc-mips.c, * config/tc-mmix.c, * config/tc-mn10200.c,
+ * config/tc-mn10300.c, * config/tc-msp430.c, * config/tc-mt.c,
+ * config/tc-nds32.c, * config/tc-or1k.c, * config/tc-ppc.c,
+ * config/tc-pru.c, * config/tc-rl78.c, * config/tc-rx.c,
+ * config/tc-s12z.c, * config/tc-s390.c, * config/tc-score.c,
+ * config/tc-score7.c, * config/tc-sh.c, * config/tc-sparc.c,
+ * config/tc-spu.c, * config/tc-tic4x.c, * config/tc-tic54x.c,
+ * config/tc-tic6x.c, * config/tc-tilegx.c, * config/tc-tilepro.c,
+ * config/tc-v850.c, * config/tc-visium.c, * config/tc-wasm32.c,
+ * config/tc-xc16x.c, * config/tc-xgate.c, * config/tc-xstormy16.c,
+ * config/tc-xtensa.c, * config/tc-z8k.c: Update throughout for
+ bfd section macro and function changes.
+ * write.c (compress_debug): Use bfd_rename_section.
+
2019-09-18 Alan Modra <amodra@gmail.com>
* symbols.c (S_IS_LOCAL): Update bfd_get_section to
/* @@ FIXME -- we're setting the RELOC flag so that sections are assumed
to have relocs, otherwise we don't find out in time. */
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, text_section,
+ bfd_set_section_flags (text_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
| SEC_CODE | SEC_READONLY));
- bfd_set_section_flags (stdoutput, data_section,
+ bfd_set_section_flags (data_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
| SEC_DATA));
- bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC);
+ bfd_set_section_flags (bss_section, applicable & SEC_ALLOC);
seg_info (bss_section)->bss = 1;
#endif
subseg_new (BFD_ABS_SECTION_NAME, 0);
segT gnustack;
gnustack = subseg_new (".note.GNU-stack", 0);
- bfd_set_section_flags (stdoutput, gnustack,
+ bfd_set_section_flags (gnustack,
SEC_READONLY | (flag_execstack ? SEC_CODE : 0));
}
/* Segment our instructions emit to. */
COMMON segT now_seg;
-#define segment_name(SEG) bfd_get_section_name (stdoutput, SEG)
+#define segment_name(SEG) bfd_section_name (SEG)
extern segT reg_section, expr_section;
/* Shouldn't these be eliminated someday? */
const char *name,*dollar, *dot;
char *sname;
- name = bfd_get_section_name (stdoutput, seg);
+ name = bfd_section_name (seg);
dollar = strchr (name, '$');
dot = strchr (name + 1, '.');
r = subseg_new (name, 0);
/* Check if code segment is marked as linked once. */
- flags = bfd_get_section_flags (stdoutput, cseg)
- & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
- | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
- | SEC_LINK_DUPLICATES_SAME_CONTENTS);
+ flags = (bfd_section_flags (cseg)
+ & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
+ | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
+ | SEC_LINK_DUPLICATES_SAME_CONTENTS));
/* Add standard section flags. */
flags |= SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA;
/* Apply possibly linked once flags to new generated segment, too. */
- if (!bfd_set_section_flags (stdoutput, r, flags))
+ if (!bfd_set_section_flags (r, flags))
as_bad (_("bfd_set_section_flags: %s"),
bfd_errmsg (bfd_get_error ()));
const char *cseg_name, *nseg_name;
if (seh_ctx_cur->code_seg == now_seg)
return 1;
- cseg_name = bfd_get_section_name (stdoutput, seh_ctx_cur->code_seg);
- nseg_name = bfd_get_section_name (stdoutput, now_seg);
+ cseg_name = bfd_section_name (seh_ctx_cur->code_seg);
+ nseg_name = bfd_section_name (now_seg);
as_bad (_("%s used in segment '%s' instead of expected '%s'"),
directive, nseg_name, cseg_name);
ignore_rest_of_line ();
char numbuff[20];
sec = subseg_new (".drectve", 0);
- oldflags = bfd_get_section_flags (stdoutput, sec);
+ oldflags = bfd_section_flags (sec);
if (oldflags == SEC_NO_FLAGS)
{
- if (!bfd_set_section_flags (stdoutput, sec,
- TC_COFF_SECTION_DEFAULT_ATTRIBUTES))
+ if (!bfd_set_section_flags (sec, TC_COFF_SECTION_DEFAULT_ATTRIBUTES))
as_warn (_("error setting flags for \"%s\": %s"),
- bfd_section_name (stdoutput, sec),
+ bfd_section_name (sec),
bfd_errmsg (bfd_get_error ()));
}
that shouldn't be loaded into memory, which requires linker
changes... For now, until proven otherwise, use .rdata. */
sec = subseg_new (".rdata$zzz", 0);
- bfd_set_section_flags (stdoutput, sec,
+ bfd_set_section_flags (sec,
((SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA)
& bfd_applicable_section_flags (stdoutput)));
}
if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN
|| S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL
- || (streq (bfd_get_section_name (stdoutput,
- S_GET_SEGMENT (def_symbol_in_progress)),
+ || (streq (bfd_section_name (S_GET_SEGMENT (def_symbol_in_progress)),
"*DEBUG*")
&& !SF_GET_TAG (def_symbol_in_progress))
|| S_GET_SEGMENT (def_symbol_in_progress) == absolute_section
fixp = fixp->fx_next;
}
}
- if (bfd_get_section_size (sec) == 0
+ if (bfd_section_size (sec) == 0
&& nrelocs == 0
&& nlnno == 0
&& sec != text_section
if (alignment >= 0)
sec->alignment_power = alignment;
- oldflags = bfd_get_section_flags (stdoutput, sec);
+ oldflags = bfd_section_flags (sec);
if (oldflags == SEC_NO_FLAGS)
{
/* Set section flags for a new section just created by subseg_new.
flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
#endif
- if (! bfd_set_section_flags (stdoutput, sec, flags))
+ if (!bfd_set_section_flags (sec, flags))
as_warn (_("error setting flags for \"%s\": %s"),
- bfd_section_name (stdoutput, sec),
+ bfd_section_name (sec),
bfd_errmsg (bfd_get_error ()));
}
else if (flags != SEC_NO_FLAGS)
supposedly because standard COFF has no other way of encoding alignment
for sections. If your COFF flavor has a different way of encoding
section alignment, then skip this step, as TICOFF does. */
- bfd_vma size = bfd_get_section_size (sec);
+ bfd_vma size = bfd_section_size (sec);
#if !defined(TICOFF)
bfd_vma align_power = (bfd_vma) sec->alignment_power + OCTETS_PER_BYTE_POWER;
bfd_vma mask = ((bfd_vma) 1 << align_power) - 1;
fragS *last;
new_size = (size + mask) & ~mask;
- bfd_set_section_size (stdoutput, sec, new_size);
+ bfd_set_section_size (sec, new_size);
/* If the size had to be rounded up, add some padding in
the last non-empty frag. */
unsigned char sclass = C_STAT;
#ifdef OBJ_XCOFF
- if (bfd_get_section_flags (stdoutput, sec) & SEC_DEBUGGING)
+ if (bfd_section_flags (sec) & SEC_DEBUGGING)
sclass = C_DWARF;
#endif
S_SET_STORAGE_CLASS (secsym, sclass);
strsec = sec;
sec = subseg_get (STAB_SECTION_NAME, 0);
/* size is already rounded up, since other section will be listed first */
- size = bfd_get_section_size (strsec);
+ size = bfd_section_size (strsec);
- n_entries = bfd_get_section_size (sec) / 12 - 1;
+ n_entries = bfd_section_size (sec) / 12 - 1;
/* Find first non-empty frag. It should be large enough. */
fragp = seg_info (sec)->frchainP->frch_root;
}
if (i == n_names)
{
- bfd_set_section_vma (stdoutput, sec, addr);
- addr += bfd_section_size (stdoutput, sec);
+ bfd_set_section_vma (sec, addr);
+ addr += bfd_section_size (sec);
}
}
for (i = 0; i < n_names; i++)
if (secs[i])
{
- bfd_set_section_vma (stdoutput, secs[i], addr);
- addr += bfd_section_size (stdoutput, secs[i]);
+ bfd_set_section_vma (secs[i], addr);
+ addr += bfd_section_size (secs[i]);
}
for (i = n_names - 1; i >= 0; i--)
if (secs[i])
if (type == SHT_NOBITS)
seg_info (sec)->bss = 1;
- bfd_set_section_flags (stdoutput, sec, flags);
+ bfd_set_section_flags (sec, flags);
if (flags & SEC_MERGE)
sec->entsize = entsize;
elf_group_name (sec) = group_name;
/* Create the .note section. */
note_secp = subseg_new (".note", 0);
- bfd_set_section_flags (stdoutput,
- note_secp,
- SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_flags (note_secp, SEC_HAS_CONTENTS | SEC_READONLY);
record_alignment (note_secp, 2);
/* Process the version string. */
{
char *p;
comment_section = subseg_new (".comment", 0);
- bfd_set_section_flags (stdoutput, comment_section,
- SEC_READONLY | SEC_HAS_CONTENTS
- | SEC_MERGE | SEC_STRINGS);
+ bfd_set_section_flags (comment_section, (SEC_READONLY | SEC_HAS_CONTENTS
+ | SEC_MERGE | SEC_STRINGS));
comment_section->entsize = 1;
#ifdef md_elf_section_change_hook
md_elf_section_change_hook ();
/* Force the section to align to a longword boundary. Without this,
UnixWare ar crashes. */
- bfd_set_section_alignment (stdoutput, seg, 2);
+ bfd_set_section_alignment (seg, 2);
/* Make space for this first symbol. */
p = frag_more (12);
name = concat (sec->name, "str", NULL);
strsec = bfd_get_section_by_name (abfd, name);
if (strsec)
- strsz = bfd_section_size (abfd, strsec);
+ strsz = bfd_section_size (strsec);
else
strsz = 0;
- nsyms = bfd_section_size (abfd, sec) / 12 - 1;
+ nsyms = bfd_section_size (sec) / 12 - 1;
p = seg_info (sec)->stabu.p;
gas_assert (p != 0);
sec_name = ".group";
s = subseg_force_new (sec_name, 0);
if (s == NULL
- || !bfd_set_section_flags (stdoutput, s, flags)
- || !bfd_set_section_alignment (stdoutput, s, 2))
+ || !bfd_set_section_flags (s, flags)
+ || !bfd_set_section_alignment (s, 2))
{
as_fatal (_("can't create group: %s"),
bfd_errmsg (bfd_get_error ()));
group = elf_sec_group (head);
subseg_set (group, 0);
- bfd_set_section_size (stdoutput, group, size);
+ bfd_set_section_size (group, size);
group->contents = (unsigned char *) frag_more (size);
frag_now->fr_fix = frag_now_fix_octets ();
frag_wane (frag_now);
to force the ELF backend to allocate a file position, and then
write out the data. FIXME: Is this really the best way to do
this? */
- bfd_set_section_size
- (stdoutput, sec, bfd_ecoff_debug_size (stdoutput, &debug, debug_swap));
+ bfd_set_section_size (sec, bfd_ecoff_debug_size (stdoutput, &debug,
+ debug_swap));
/* Pass BUF to bfd_set_section_contents because this will
eventually become a call to fwrite, and ISO C prohibits
/* Sub-segments don't exists as is on Mach-O. */
sec = subseg_new (name, 0);
- oldflags = bfd_get_section_flags (stdoutput, sec);
+ oldflags = bfd_section_flags (sec);
msect = bfd_mach_o_get_mach_o_section (sec);
if (oldflags == SEC_NO_FLAGS)
flags |= SEC_DEBUGGING;
/* New, so just use the defaults or what's specified. */
- if (! bfd_set_section_flags (stdoutput, sec, flags))
+ if (!bfd_set_section_flags (sec, flags))
as_warn (_("failed to set flags for \"%s\": %s"),
- bfd_section_name (stdoutput, sec),
+ bfd_section_name (sec),
bfd_errmsg (bfd_get_error ()));
strncpy (msect->segname, segname, BFD_MACH_O_SEGNAME_SIZE);
obj_mach_o_set_section_vma (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *v_p)
{
bfd_mach_o_section *ms = bfd_mach_o_get_mach_o_section (sec);
- unsigned bfd_align = bfd_get_section_alignment (abfd, sec);
+ unsigned bfd_align = bfd_section_alignment (sec);
obj_mach_o_set_vma_data *p = (struct obj_mach_o_set_vma_data *)v_p;
unsigned sectype = (ms->flags & BFD_MACH_O_SECTION_TYPE_MASK);
unsigned zf;
/* We know the section size now - so make a vma for the section just
based on order. */
- ms->size = bfd_get_section_size (sec);
+ ms->size = bfd_section_size (sec);
/* Make sure that the align agrees, and set to the largest value chosen. */
ms->align = ms->align > bfd_align ? ms->align : bfd_align;
- bfd_set_section_alignment (abfd, sec, ms->align);
+ bfd_set_section_alignment (sec, ms->align);
p->vma += (1 << ms->align) - 1;
p->vma &= ~((1 << ms->align) - 1);
ms->addr = p->vma;
- bfd_set_section_vma (abfd, sec, p->vma);
+ bfd_set_section_vma (sec, p->vma);
p->vma += ms->size;
}
obj_mach_o_set_indirect_symbols (bfd *abfd, asection *sec,
void *xxx ATTRIBUTE_UNUSED)
{
- bfd_vma sect_size = bfd_section_size (abfd, sec);
+ bfd_vma sect_size = bfd_section_size (sec);
bfd_mach_o_section *ms = bfd_mach_o_get_mach_o_section (sec);
unsigned lazy = 0;
of the various stabs spaces/subspaces need to be "small". We
reserve range 72/73 which appear to work well. */
obj_set_section_attributes (space, 1, 1, 72, 2);
- bfd_set_section_alignment (stdoutput, space, 2);
+ bfd_set_section_alignment (space, 2);
/* Set the containing space for both stab sections to be $GDB_DEBUG$
(just created above). Also set some attributes which BFD does
not understand. In particular, access bits, sort keys, and load
quadrant. */
obj_set_subsection_attributes (seg, space, 0x1f, 73, 0, 0, 0, 0);
- bfd_set_section_alignment (stdoutput, seg, 2);
+ bfd_set_section_alignment (seg, 2);
/* Make some space for the first special stab entry and zero the memory.
It contains information about the length of this file's
quadrant. */
seg = bfd_get_section_by_name (stdoutput, "$GDB_STRINGS$");
obj_set_subsection_attributes (seg, space, 0x1f, 72, 0, 0, 0, 0);
- bfd_set_section_alignment (stdoutput, seg, 2);
+ bfd_set_section_alignment (seg, 2);
subseg_set (saved_seg, saved_subseg);
}
strsec = bfd_get_section_by_name (abfd, "$GDB_STRINGS$");
if (strsec)
- strsz = bfd_section_size (abfd, strsec);
+ strsz = bfd_section_size (strsec);
else
strsz = 0;
- nsyms = bfd_section_size (abfd, sec) / 12 - 1;
+ nsyms = bfd_section_size (sec) / 12 - 1;
p = seg_info (sec)->stabu.p;
gas_assert (p != 0);
/* PR 21809: Do not set a mapping state for debug sections
- it just confuses other tools. */
- if (bfd_get_section_flags (NULL, now_seg) & SEC_DEBUGGING)
+ if (bfd_section_flags (now_seg) & SEC_DEBUGGING)
return;
switch (fragP->fr_type)
*secp = new_sec = subseg_new (name, 0);
subseg_set (current_section, current_subsec);
- bfd_set_section_alignment (stdoutput, new_sec, 4);
- bfd_set_section_flags (stdoutput, new_sec,
- SEC_RELOC | SEC_ALLOC | SEC_LOAD | SEC_READONLY
- | SEC_DATA);
+ bfd_set_section_alignment (new_sec, 4);
+ bfd_set_section_flags (new_sec, (SEC_RELOC | SEC_ALLOC | SEC_LOAD
+ | SEC_READONLY | SEC_DATA));
S_CLEAR_EXTERNAL (*symp = section_symbol (new_sec));
}
if (alpha_flag_mdebug < 0)
{
segT sec = subseg_new (".mdebug", 0);
- bfd_set_section_flags (stdoutput, sec, SEC_HAS_CONTENTS | SEC_READONLY);
- bfd_set_section_alignment (stdoutput, sec, 3);
+ bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_alignment (sec, 3);
ecoff_read_begin_hook ();
if (!sec)
return;
- vma = bfd_get_section_vma (sec->owner, sec);
+ vma = bfd_section_vma (sec);
if (vma && vma < alpha_gp_value)
alpha_gp_value = vma;
}
if (ECOFF_DEBUGGING)
{
segT sec = subseg_new (".mdebug", (subsegT) 0);
- bfd_set_section_flags (stdoutput, sec, SEC_HAS_CONTENTS | SEC_READONLY);
- bfd_set_section_alignment (stdoutput, sec, 3);
+ bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_alignment (sec, 3);
}
#endif
valueT
md_section_align (segT seg, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
valueT mask = ((valueT) 1 << align) - 1;
return (size + mask) & ~mask;
md_section_align (segT segment,
valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
}
if (!arcext_section)
{
arcext_section = subseg_new (".arcextmap", 0);
- bfd_set_section_flags (stdoutput, arcext_section,
- SEC_READONLY | SEC_HAS_CONTENTS);
+ bfd_set_section_flags (arcext_section, SEC_READONLY | SEC_HAS_CONTENTS);
}
else
subseg_set (arcext_section, 0);
out of the jump table, and chaos would ensue. */
if (label_is_thumb_function_name
&& (S_GET_NAME (sym)[0] != '.' || S_GET_NAME (sym)[1] != 'L')
- && (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ && (bfd_section_flags (now_seg) & SEC_CODE) != 0)
{
/* When the address of a Thumb function is taken the bottom
bit of that address should be set. This will allow
/* PR 21809: Do not set a mapping state for debug sections
- it just confuses other tools. */
- if (bfd_get_section_flags (NULL, now_seg) & SEC_DEBUGGING)
+ if (bfd_section_flags (now_seg) & SEC_DEBUGGING)
return;
frag_thumb_mode = fragP->tc_frag_data.thumb_mode ^ MODE_RECORDED;
if (sec != NULL)
{
- bfd_set_section_flags
- (stdoutput, sec, SEC_READONLY | SEC_DEBUGGING /* | SEC_HAS_CONTENTS */);
- bfd_set_section_size (stdoutput, sec, 0);
+ bfd_set_section_flags (sec, SEC_READONLY | SEC_DEBUGGING);
+ bfd_set_section_size (sec, 0);
bfd_set_section_contents (stdoutput, sec, NULL, 0, 0);
}
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & (-1UL << align));
}
sec = bfd_make_section (stdoutput, section_name);
if (sec == NULL)
as_fatal (_("Failed to create property section `%s'\n"), section_name);
- bfd_set_section_flags (stdoutput, sec, flags);
+ bfd_set_section_flags (sec, flags);
sec->output_section = sec;
return sec;
}
return;
prop_sec = avr_create_property_section ();
- bfd_set_section_size (stdoutput, prop_sec, sec_size);
+ bfd_set_section_size (prop_sec, sec_size);
subseg_set (prop_sec, 0);
frag_base = frag_more (sec_size);
valueT
md_section_align (segT segment, valueT size)
{
- int boundary = bfd_get_section_alignment (stdoutput, segment);
+ int boundary = bfd_section_alignment (segment);
return ((size + (1 << boundary) - 1) & -(1 << boundary));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
if (pfill == NULL)
{
if (n > 2
- && (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ && (bfd_section_flags (now_seg) & SEC_CODE) != 0)
{
static char const nop[4] = { 0x00, 0xf0, 0x00, 0x00 };
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
segment_info_type *seginfo = seg_info (sec);
fixS *fixp;
CGEN_CPU_DESC cd = gas_cgen_cpu_desc;
- flagword flags = bfd_get_section_flags (abfd, sec);
+ flagword flags = bfd_section_flags (sec);
/* Skip relocations in known sections (.ctors, .dtors, and .gcc_except_table)
since we can fix those up by hand. */
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & (-1U << align));
}
valueT
md_section_align (asection *segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
int align2 = (1 << align) - 1;
return (size + align2) & ~align2;
char *name, *p;
symbolS *symbolP;
- if ((bfd_get_section_flags (stdoutput, now_seg)
+ if ((bfd_section_flags (now_seg)
& (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
!= (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
return;
if (seg == ASEC_NULL)
{
seg = subseg_new (UNWIND_SECTION_NAME, 0);
- bfd_set_section_flags (stdoutput, seg,
- SEC_READONLY | SEC_HAS_CONTENTS
- | SEC_LOAD | SEC_RELOC | SEC_ALLOC | SEC_DATA);
- bfd_set_section_alignment (stdoutput, seg, 2);
+ bfd_set_section_flags (seg, (SEC_READONLY | SEC_HAS_CONTENTS | SEC_LOAD
+ | SEC_RELOC | SEC_ALLOC | SEC_DATA));
+ bfd_set_section_alignment (seg, 2);
}
subseg_set (seg, 0);
seg_info (section)->bss = 1;
/* Now set the flags. */
- bfd_set_section_flags (stdoutput, section, applicable);
+ bfd_set_section_flags (section, applicable);
/* Record any alignment request for this section. */
record_alignment (section, exact_log2 (alignment));
/* Set the starting offset for this section. */
- bfd_set_section_vma (stdoutput, section,
- pa_subspace_start (space, quadrant));
+ bfd_set_section_vma (section, pa_subspace_start (space, quadrant));
/* Now that all the flags are set, update an existing subspace,
or create a new one. */
{
text_section = segment;
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, segment,
+ bfd_set_section_flags (segment,
applicable & (SEC_ALLOC | SEC_LOAD
| SEC_RELOC | SEC_CODE
| SEC_READONLY
{
data_section = segment;
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, segment,
+ bfd_set_section_flags (segment,
applicable & (SEC_ALLOC | SEC_LOAD
| SEC_RELOC
| SEC_HAS_CONTENTS));
{
bss_section = segment;
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, segment,
+ bfd_set_section_flags (segment,
applicable & SEC_ALLOC);
}
else if (!strcmp (pa_def_subspaces[i].name, "$LIT$"))
{
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, segment,
+ bfd_set_section_flags (segment,
applicable & (SEC_ALLOC | SEC_LOAD
| SEC_RELOC
| SEC_READONLY
else if (!strcmp (pa_def_subspaces[i].name, "$MILLICODE$"))
{
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, segment,
+ bfd_set_section_flags (segment,
applicable & (SEC_ALLOC | SEC_LOAD
| SEC_RELOC
| SEC_READONLY
else if (!strcmp (pa_def_subspaces[i].name, "$UNWIND$"))
{
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, segment,
+ bfd_set_section_flags (segment,
applicable & (SEC_ALLOC | SEC_LOAD
| SEC_RELOC
| SEC_READONLY
/* Create the .note.gnu.property section. */
sec = subseg_new (NOTE_GNU_PROPERTY_SECTION_NAME, 0);
- bfd_set_section_flags (stdoutput, sec,
+ bfd_set_section_flags (sec,
(SEC_ALLOC
| SEC_LOAD
| SEC_DATA
alignment = 2;
}
- bfd_set_section_alignment (stdoutput, sec, alignment);
+ bfd_set_section_alignment (sec, alignment);
elf_section_type (sec) = SHT_NOTE;
/* GNU_PROPERTY_X86_ISA_1_USED: 4-byte type + 4-byte data size
work. */
int align;
- align = bfd_get_section_alignment (stdoutput, segment);
+ align = bfd_section_alignment (segment);
size = ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
}
#endif
/* The .lbss section is for local .largecomm symbols. */
lbss_section = subseg_new (".lbss", 0);
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, lbss_section,
- applicable & SEC_ALLOC);
+ bfd_set_section_flags (lbss_section, applicable & SEC_ALLOC);
seg_info (lbss_section)->bss = 1;
subseg_set (seg, subseg);
record_alignment (now_seg, log_align);
- cur_size = bfd_section_size (stdoutput, now_seg);
+ cur_size = bfd_section_size (now_seg);
if ((int) size > cur_size)
{
char *pfrag
= frag_var (rs_fill, 1, 1, (relax_substateT)0, NULL,
(valueT)size - (valueT)cur_size, NULL);
*pfrag = 0;
- bfd_section_size (stdoutput, now_seg) = size;
+ bfd_set_section_size (now_seg, size);
}
/* Switch back to current segment. */
else
{
set_section (sec_name);
- bfd_set_section_flags (stdoutput, now_seg,
- SEC_LOAD | SEC_ALLOC | SEC_READONLY);
+ bfd_set_section_flags (now_seg, SEC_LOAD | SEC_ALLOC | SEC_READONLY);
}
elf_linked_to_section (now_seg) = text_seg;
md.auto_align = 1;
md.explicit_mode = md.default_explicit_mode;
- bfd_set_section_alignment (stdoutput, text_section, 4);
+ bfd_set_section_alignment (text_section, 4);
/* Make sure function pointers get initialized. */
target_big_endian = -1;
return;
}
- if (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)
+ if (bfd_section_flags (now_seg) & SEC_CODE)
{
md.last_text_seg = now_seg;
fix = XOBNEW (¬es, struct label_fix);
ia64_flush_pending_output (void)
{
if (!md.keep_pending_output
- && bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE)
+ && bfd_section_flags (now_seg) & SEC_CODE)
{
/* ??? This causes many unnecessary stop bits to be emitted.
Unfortunately, it isn't clear if it is safe to remove this. */
{
unsigned long off = fix->fx_frag->fr_address + fix->fx_where;
- if (bfd_get_section_flags (stdoutput, sec) & SEC_CODE)
+ if (bfd_section_flags (sec) & SEC_CODE)
off &= ~0xfUL;
return off;
/* Create the .note section. */
secp = subseg_new (".note", 0);
- bfd_set_section_flags (stdoutput,
- secp,
- SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_flags (secp, SEC_HAS_CONTENTS | SEC_READONLY);
/* Module header note (MHD). */
bname = xstrdup (lbasename (out_file_name));
frag_align (3, 0, 0);
secp = subseg_new (".vms_display_name_info", 0);
- bfd_set_section_flags (stdoutput,
- secp,
- SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_flags (secp, SEC_HAS_CONTENTS | SEC_READONLY);
/* This symbol should be passed on the command line and be variable
according to language. */
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
else
p = NULL;
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
if (ISDIGIT (*input_line_pointer) || *input_line_pointer == '-')
get_number ();
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
/* This is copied from perform_an_assembly_pass. */
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, sbss_section, applicable & SEC_ALLOC);
+ bfd_set_section_flags (sbss_section, applicable & SEC_ALLOC);
subseg_set (seg, subseg);
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
|| S_IS_WEAK (fragP->fr_symbol)
#ifdef MEP_IVC2_SUPPORTED
|| (mep_cop == EF_MEP_COP_IVC2
- && bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)
+ && bfd_section_flags (segment) & SEC_MEP_VLIW)
#endif /* MEP_IVC2_SUPPORTED */
)
{
}
if (MEP_VLIW && ! MEP_VLIW64
- && (bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW))
+ && (bfd_section_flags (segment) & SEC_MEP_VLIW))
{
/* Use 32 bit branches for vliw32 so the vliw word is not split. */
switch (fragP->fr_cgen.insn->base->num)
#ifdef MEP_IVC2_SUPPORTED
if (mep_cop == EF_MEP_COP_IVC2
- && bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)
+ && bfd_section_flags (segment) & SEC_MEP_VLIW)
return 0;
#endif /* MEP_IVC2_SUPPORTED */
long rv = relax_frag (segment, fragP, stretch);
#ifdef MEP_IVC2_SUPPORTED
if (mep_cop == EF_MEP_COP_IVC2
- && bfd_get_section_flags (stdoutput, segment) & SEC_MEP_VLIW)
+ && bfd_section_flags (segment) & SEC_MEP_VLIW)
return 0;
#endif
return rv;
int core_mode;
#ifdef MEP_IVC2_SUPPORTED
- if (bfd_get_section_flags (stdoutput, seg) & SEC_MEP_VLIW
+ if (bfd_section_flags (seg) & SEC_MEP_VLIW
&& mep_cop == EF_MEP_COP_IVC2)
core_mode = 0;
else
{
flagword applicable = bfd_applicable_section_flags (stdoutput);
vtext_section = subseg_new (VTEXT_SECTION_NAME, 0);
- bfd_set_section_flags (stdoutput, vtext_section,
+ bfd_set_section_flags (vtext_section,
applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC
| SEC_CODE | SEC_READONLY
| SEC_MEP_VLIW));
{
if (S_IS_WEAK (fixP->fx_addsy)
|| (symbol_used_in_reloc_p (fixP->fx_addsy)
- && (((bfd_get_section_flags (stdoutput,
- S_GET_SEGMENT (fixP->fx_addsy))
+ && (((bfd_section_flags (S_GET_SEGMENT (fixP->fx_addsy))
& SEC_LINK_ONCE) != 0)
|| !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
".gnu.linkonce",
if (strncmp (TARGET_OS, "elf", 3) != 0
&& strncmp (TARGET_OS, "vxworks", 7) != 0)
{
- (void) bfd_set_section_alignment (stdoutput, text_section, 4);
- (void) bfd_set_section_alignment (stdoutput, data_section, 4);
- (void) bfd_set_section_alignment (stdoutput, bss_section, 4);
+ bfd_set_section_alignment (text_section, 4);
+ bfd_set_section_alignment (data_section, 4);
+ bfd_set_section_alignment (bss_section, 4);
}
/* Create a .reginfo section for register masks and a .mdebug
{
sec = subseg_new (".reginfo", (subsegT) 0);
- bfd_set_section_flags (stdoutput, sec, flags);
- bfd_set_section_alignment (stdoutput, sec, HAVE_NEWABI ? 3 : 2);
+ bfd_set_section_flags (sec, flags);
+ bfd_set_section_alignment (sec, HAVE_NEWABI ? 3 : 2);
mips_regmask_frag = frag_more (sizeof (Elf32_External_RegInfo));
}
/* The 64-bit ABI uses a .MIPS.options section rather than
.reginfo section. */
sec = subseg_new (".MIPS.options", (subsegT) 0);
- bfd_set_section_flags (stdoutput, sec, flags);
- bfd_set_section_alignment (stdoutput, sec, 3);
+ bfd_set_section_flags (sec, flags);
+ bfd_set_section_alignment (sec, 3);
/* Set up the option header. */
{
}
sec = subseg_new (".MIPS.abiflags", (subsegT) 0);
- bfd_set_section_flags (stdoutput, sec,
+ bfd_set_section_flags (sec,
SEC_READONLY | SEC_DATA | SEC_ALLOC | SEC_LOAD);
- bfd_set_section_alignment (stdoutput, sec, 3);
+ bfd_set_section_alignment (sec, 3);
mips_flags_frag = frag_more (sizeof (Elf_External_ABIFlags_v0));
if (ECOFF_DEBUGGING)
{
sec = subseg_new (".mdebug", (subsegT) 0);
- (void) bfd_set_section_flags (stdoutput, sec,
- SEC_HAS_CONTENTS | SEC_READONLY);
- (void) bfd_set_section_alignment (stdoutput, sec, 2);
+ bfd_set_section_flags (sec, SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_alignment (sec, 2);
}
else if (mips_flag_pdr)
{
pdr_seg = subseg_new (".pdr", (subsegT) 0);
- (void) bfd_set_section_flags (stdoutput, pdr_seg,
- SEC_READONLY | SEC_RELOC
- | SEC_DEBUGGING);
- (void) bfd_set_section_alignment (stdoutput, pdr_seg, 2);
+ bfd_set_section_flags (pdr_seg,
+ SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
+ bfd_set_section_alignment (pdr_seg, 2);
}
subseg_set (seg, subseg);
if (symseg != from_seg && !S_IS_LOCAL (sym))
{
- if ((bfd_get_section_flags (stdoutput, symseg) & SEC_LINK_ONCE))
+ if ((bfd_section_flags (symseg) & SEC_LINK_ONCE))
linkonce = TRUE;
/* The GNU toolchain uses an extension for ELF: a section
beginning with the magic string .gnu.linkonce is a
}
new_seg = subseg_new (newname, (subsegT) 0);
- bfd_set_section_flags (stdoutput, new_seg,
+ bfd_set_section_flags (new_seg,
SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_DATA);
frag_align (length == 4 ? 2 : 3, 0, 0);
if (strncmp (TARGET_OS, "elf", 3) != 0)
&& fixP->fx_done
&& fixP->fx_frag->fr_address >= text_section->vma
&& (fixP->fx_frag->fr_address
- < text_section->vma + bfd_get_section_size (text_section))
+ < text_section->vma + bfd_section_size (text_section))
&& ((insn & 0xffff0000) == 0x10000000 /* beq $0,$0 */
|| (insn & 0xffff0000) == 0x04010000 /* bgez $0 */
|| (insn & 0xffff0000) == 0x04110000)) /* bgezal $0 */
case 'r':
seg = subseg_new (RDATA_SECTION_NAME,
(subsegT) get_absolute_expression ());
- bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD
- | SEC_READONLY | SEC_RELOC
- | SEC_DATA));
+ bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY
+ | SEC_RELOC | SEC_DATA));
if (strncmp (TARGET_OS, "elf", 3) != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
case 's':
seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
- bfd_set_section_flags (stdoutput, seg,
+ bfd_set_section_flags (seg,
SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
if (strncmp (TARGET_OS, "elf", 3) != 0)
record_alignment (seg, 4);
case 'B':
seg = subseg_new (".sbss", (subsegT) get_absolute_expression ());
- bfd_set_section_flags (stdoutput, seg, SEC_ALLOC);
+ bfd_set_section_flags (seg, SEC_ALLOC);
if (strncmp (TARGET_OS, "elf", 3) != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
/* We don't need to align ELF sections to the full alignment.
However, Irix 5 may prefer that we align them at least to a 16
else
p = NULL;
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) == 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) == 0)
as_warn (_(".end not in text section"));
if (!cur_proc_ptr)
|| *input_line_pointer == '-')
get_number ();
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) == 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) == 0)
as_warn (_(".ent or .aent not in text section"));
if (!aent && cur_proc_ptr)
if (sec == NULL)
as_fatal (_("can't create section %s"), newsecname);
- if (!bfd_set_section_flags (stdoutput, sec,
- bfd_get_section_flags (stdoutput, sec)
- | SEC_READONLY))
+ if (!bfd_set_section_flags (sec,
+ bfd_section_flags (sec) | SEC_READONLY))
as_fatal (_("can't set section flags for section %s"), newsecname);
}
than just helping the user around this limitation here; hopefully the
code using the local expression is around. Putting the LOCAL
semantics in a relocation still seems right; a section didn't do. */
- if (bfd_section_size (section->owner, section) == 0)
+ if (bfd_section_size (section) == 0)
as_bad_where
(fixP->fx_file, fixP->fx_line,
fixP->fx_r_type == BFD_RELOC_MMIX_LOCAL
resolve the relocation here. */
if (addsy != NULL
&& (bfd_is_und_section (addsec)
- || strcmp (bfd_get_section_name (addsec->owner, addsec),
+ || strcmp (bfd_section_name (addsec),
MMIX_REG_CONTENTS_SECTION_NAME) == 0))
{
code = fixP->fx_r_type;
case BFD_RELOC_MMIX_BASE_PLUS_OFFSET:
if (addsy != NULL
- && strcmp (bfd_get_section_name (addsec->owner, addsec),
+ && strcmp (bfd_section_name (addsec),
MMIX_REG_CONTENTS_SECTION_NAME) == 0)
{
/* This changed into a register; the relocation is for the
case BFD_RELOC_MMIX_REG:
if (addsy != NULL
&& (bfd_is_und_section (addsec)
- || strcmp (bfd_get_section_name (addsec->owner, addsec),
+ || strcmp (bfd_section_name (addsec),
MMIX_REG_CONTENTS_SECTION_NAME) == 0))
{
code = fixP->fx_r_type;
if (real_reg_section != NULL)
{
/* FIXME: Pass error state gracefully. */
- if (bfd_get_section_flags (stdoutput, real_reg_section) & SEC_HAS_CONTENTS)
+ if (bfd_section_flags (real_reg_section) & SEC_HAS_CONTENTS)
as_fatal (_("register section has contents\n"));
bfd_section_list_remove (stdoutput, real_reg_section);
if (doing_bspec)
as_bad (_("section change from within a BSPEC/ESPEC pair is not supported"));
- last_alignment = bfd_get_section_alignment (now_seg->owner, now_seg);
+ last_alignment = bfd_section_alignment (now_seg);
want_unaligned = 0;
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
&& now_seg != bss_section
/* Do not create relocs for the merging sections - such
relocs will prevent the contents from being merged. */
- && (bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE) == 0)
+ && (bfd_section_flags (now_seg) & SEC_MERGE) == 0)
/* Create a new fixup to record the alignment request. The symbol is
irrelevant but must be present so we use the absolute section symbol.
The offset from the symbol is used to record the power-of-two alignment
valueT
md_section_align (asection * seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
seg->s = subseg_new (seg->name, sub);
if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
{
- bfd_set_section_flags (stdoutput, seg->s, seg->flags);
+ bfd_set_section_flags (seg->s, seg->flags);
if ((seg->flags & SEC_LOAD) == 0)
seg_info (seg->s)->bss = 1;
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & ((valueT) -1 << align));
}
unsigned int n ATTRIBUTE_UNUSED)
{
bfd *abfd ATTRIBUTE_UNUSED = sec->owner;
- if (bfd_get_section_flags (abfd, sec) & (flagword) SEC_RELOC)
+ if (bfd_section_flags (sec) & (flagword) SEC_RELOC)
nds32_insertion_sort (sec->orelocation, sec->reloc_count,
sizeof (arelent**), compar_relent);
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
/* Create the .PPC.EMB.apuinfo section. */
apuinfo_secp = subseg_new (APUINFO_SECTION_NAME, 0);
- bfd_set_section_flags (stdoutput,
- apuinfo_secp,
- SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_flags (apuinfo_secp, SEC_HAS_CONTENTS | SEC_READONLY);
p = frag_more (4);
md_number_to_chars (p, (valueT) 8, 4);
toc = bfd_get_section_by_name (stdoutput, ".toc");
if (toc != NULL
&& toc_reloc_types != has_large_toc_reloc
- && bfd_section_size (stdoutput, toc) > 0x10000)
+ && bfd_section_size (toc) > 0x10000)
as_warn (_("TOC section size exceeds 64k"));
}
const struct xcoff_dwsect_name *dw = &xcoff_dwsect_names[idx];
sec = subseg_new (dw->name, subseg);
- oldflags = bfd_get_section_flags (stdoutput, sec);
+ oldflags = bfd_section_flags (sec);
if (oldflags == SEC_NO_FLAGS)
{
/* Just created section. */
gas_assert (dw_sections[idx].sect == NULL);
- bfd_set_section_flags (stdoutput, sec, SEC_DEBUGGING);
- bfd_set_section_alignment (stdoutput, sec, 0);
+ bfd_set_section_flags (sec, SEC_DEBUGGING);
+ bfd_set_section_alignment (sec, 0);
dw_sections[idx].sect = sec;
}
{
pdata_section = subseg_new (".pdata", 0);
- bfd_set_section_flags (stdoutput, pdata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA ));
+ bfd_set_section_flags (pdata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+ | SEC_READONLY | SEC_DATA));
- bfd_set_section_alignment (stdoutput, pdata_section, 2);
+ bfd_set_section_alignment (pdata_section, 2);
}
else
{
if (ydata_section == 0)
{
ydata_section = subseg_new (".ydata", 0);
- bfd_set_section_flags (stdoutput, ydata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA ));
+ bfd_set_section_flags (ydata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+ | SEC_READONLY | SEC_DATA ));
- bfd_set_section_alignment (stdoutput, ydata_section, 3);
+ bfd_set_section_alignment (ydata_section, 3);
}
else
{
{
reldata_section = subseg_new (".reldata", 0);
- bfd_set_section_flags (stdoutput, reldata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_DATA));
+ bfd_set_section_flags (reldata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+ | SEC_DATA));
- bfd_set_section_alignment (stdoutput, reldata_section, 2);
+ bfd_set_section_alignment (reldata_section, 2);
}
else
{
if (rdata_section == 0)
{
rdata_section = subseg_new (".rdata", 0);
- bfd_set_section_flags (stdoutput, rdata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA ));
+ bfd_set_section_flags (rdata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+ | SEC_READONLY | SEC_DATA ));
- bfd_set_section_alignment (stdoutput, rdata_section, 2);
+ bfd_set_section_alignment (rdata_section, 2);
}
else
{
if (flags != SEC_NO_FLAGS)
{
- if (! bfd_set_section_flags (stdoutput, sec, flags))
+ if (!bfd_set_section_flags (sec, flags))
as_bad (_("error setting flags for \"%s\": %s"),
- bfd_section_name (stdoutput, sec),
+ bfd_section_name (sec),
bfd_errmsg (bfd_get_error ()));
}
- bfd_set_section_alignment (stdoutput, sec, align);
+ bfd_set_section_alignment (sec, align);
}
static void
{
tocdata_section = subseg_new (".tocd", 0);
/* FIXME: section flags won't work. */
- bfd_set_section_flags (stdoutput, tocdata_section,
- (SEC_ALLOC | SEC_LOAD | SEC_RELOC
- | SEC_READONLY | SEC_DATA));
+ bfd_set_section_flags (tocdata_section, (SEC_ALLOC | SEC_LOAD | SEC_RELOC
+ | SEC_READONLY | SEC_DATA));
- bfd_set_section_alignment (stdoutput, tocdata_section, 2);
+ bfd_set_section_alignment (tocdata_section, 2);
}
else
{
/* This is a csect symbol. x_scnlen is the size of the
csect. */
if (symbol_get_tc (sym)->next == (symbolS *) NULL)
- a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
- S_GET_SEGMENT (sym))
+ a->x_csect.x_scnlen.l = (bfd_section_size (S_GET_SEGMENT (sym))
- S_GET_VALUE (sym));
else
{
|| symbol_get_tc (next)->symbol_class != XMC_TC)
{
if (ppc_after_toc_frag == (fragS *) NULL)
- a->x_csect.x_scnlen.l = (bfd_section_size (stdoutput,
- data_section)
+ a->x_csect.x_scnlen.l = (bfd_section_size (data_section)
- S_GET_VALUE (sym));
else
a->x_csect.x_scnlen.l = (ppc_after_toc_frag->fr_address
static bfd_vma vma = 0;
/* Dwarf sections start at 0. */
- if (bfd_get_section_flags (NULL, sec) & SEC_DEBUGGING)
+ if (bfd_section_flags (sec) & SEC_DEBUGGING)
return;
vma = md_section_align (sec, vma);
- bfd_set_section_vma (stdoutput, sec, vma);
- vma += bfd_section_size (stdoutput, sec);
+ bfd_set_section_vma (sec, vma);
+ vma += bfd_section_size (sec);
}
#endif /* OBJ_XCOFF */
#ifdef OBJ_ELF
return addr;
#else
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
#endif
return 0;
/* Always adjust symbols in debugging sections. */
- if (bfd_get_section_flags (stdoutput, symseg) & SEC_DEBUGGING)
+ if (bfd_section_flags (symseg) & SEC_DEBUGGING)
return 1;
if (ppc_toc_csect != (symbolS *) NULL
#else
/* We want to use the offset within the toc, not the actual VMA
of the symbol. */
- fixP->fx_addnumber =
- - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP->fx_addsy))
- - S_GET_VALUE (ppc_toc_csect);
+ fixP->fx_addnumber = (- bfd_section_vma (S_GET_SEGMENT (fixP->fx_addsy))
+ - S_GET_VALUE (ppc_toc_csect));
/* Set *valP to avoid errors. */
*valP = value;
#endif
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & (-((valueT) 1 << align)));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
obj_elf_change_section (name, type, 0, attr, 0, NULL, FALSE, FALSE);
}
- bfd_set_section_alignment (stdoutput, now_seg, align);
+ bfd_set_section_alignment (now_seg, align);
}
static void
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
linkonce = FALSE;
if (symsec != segtype && ! S_IS_LOCAL (sym))
{
- if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0)
+ if ((bfd_section_flags (symsec) & SEC_LINK_ONCE) != 0)
linkonce = TRUE;
/* The GNU toolchain uses an extension for ELF: a section
s3_score_s_section (int ignore)
{
obj_elf_section (ignore);
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
record_alignment (now_seg, 2);
}
{
case 'r':
seg = subseg_new (s3_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ());
- bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
+ bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
if (strcmp (TARGET_OS, "elf") != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
break;
case 's':
seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
- bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
+ bfd_set_section_flags (seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
if (strcmp (TARGET_OS, "elf") != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
s3_get_number ();
#ifdef BFD_ASSEMBLER
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
p = NULL;
#ifdef BFD_ASSEMBLER
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
if (OUTPUT_FLAVOR == bfd_target_ecoff_flavour || OUTPUT_FLAVOR == bfd_target_elf_flavour)
{
/* For Score and Alpha ECOFF or ELF, small objects are put in .sbss. */
- if ((unsigned)temp <= bfd_get_gp_size (stdoutput))
- {
- bss_seg = subseg_new (".sbss", 1);
- seg_info (bss_seg)->bss = 1;
+ if ((unsigned) temp <= bfd_get_gp_size (stdoutput))
+ {
+ bss_seg = subseg_new (".sbss", 1);
+ seg_info (bss_seg)->bss = 1;
#ifdef BFD_ASSEMBLER
- if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
- as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ()));
+ if (!bfd_set_section_flags (bss_seg, SEC_ALLOC))
+ as_warn (_("error setting flags for \".sbss\": %s"),
+ bfd_errmsg (bfd_get_error ()));
#endif
- }
+ }
}
#endif
seg = now_seg;
subseg = now_subseg;
s3_pdr_seg = subseg_new (".pdr", (subsegT) 0);
- (void)bfd_set_section_flags (stdoutput, s3_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
- (void)bfd_set_section_alignment (stdoutput, s3_pdr_seg, 2);
+ bfd_set_section_flags (s3_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
+ bfd_set_section_alignment (s3_pdr_seg, 2);
subseg_set (seg, subseg);
if (s3_USE_GLOBAL_POINTER_OPT)
static valueT
s3_section_align (segT segment ATTRIBUTE_UNUSED, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
linkonce = FALSE;
if (symsec != segtype && ! S_IS_LOCAL (sym))
{
- if ((bfd_get_section_flags (stdoutput, symsec) & SEC_LINK_ONCE) != 0)
+ if ((bfd_section_flags (symsec) & SEC_LINK_ONCE) != 0)
linkonce = TRUE;
/* The GNU toolchain uses an extension for ELF: a section
s7_s_section (int ignore)
{
obj_elf_section (ignore);
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
record_alignment (now_seg, 2);
}
{
case 'r':
seg = subseg_new (s7_RDATA_SECTION_NAME, (subsegT) get_absolute_expression ());
- bfd_set_section_flags (stdoutput, seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
+ bfd_set_section_flags (seg, (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_RELOC | SEC_DATA));
if (strcmp (TARGET_OS, "elf") != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
break;
case 's':
seg = subseg_new (".sdata", (subsegT) get_absolute_expression ());
- bfd_set_section_flags (stdoutput, seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
+ bfd_set_section_flags (seg, SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA);
if (strcmp (TARGET_OS, "elf") != 0)
record_alignment (seg, 4);
demand_empty_rest_of_line ();
s7_get_number ();
#ifdef BFD_ASSEMBLER
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
p = NULL;
#ifdef BFD_ASSEMBLER
- if ((bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0)
+ if ((bfd_section_flags (now_seg) & SEC_CODE) != 0)
maybe_text = 1;
else
maybe_text = 0;
bss_seg = subseg_new (".sbss", 1);
seg_info (bss_seg)->bss = 1;
#ifdef BFD_ASSEMBLER
- if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
+ if (!bfd_set_section_flags (bss_seg, SEC_ALLOC))
as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ()));
#endif
}
seg = now_seg;
subseg = now_subseg;
s7_pdr_seg = subseg_new (".pdr", (subsegT) 0);
- (void) bfd_set_section_flags (stdoutput, s7_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
- (void) bfd_set_section_alignment (stdoutput, s7_pdr_seg, 2);
+ bfd_set_section_flags (s7_pdr_seg, SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
+ bfd_set_section_alignment (s7_pdr_seg, 2);
subseg_set (seg, subseg);
if (s7_USE_GLOBAL_POINTER_OPT)
static valueT
s7_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
#ifdef OBJ_ELF
return size;
#else /* ! OBJ_ELF */
- return ((size + (1 << bfd_get_section_alignment (stdoutput, seg)) - 1)
- & -(1 << bfd_get_section_alignment (stdoutput, seg)));
+ return ((size + (1 << bfd_section_alignment (seg)) - 1)
+ & -(1 << bfd_section_alignment (seg)));
#endif /* ! OBJ_ELF */
}
}
/* Nothing is aligned in DWARF debugging sections. */
- if (bfd_get_section_flags (stdoutput, section) & SEC_DEBUGGING)
+ if (bfd_section_flags (section) & SEC_DEBUGGING)
switch (code)
{
case BFD_RELOC_16: code = BFD_RELOC_SPARC_UA16; break;
valueT
md_section_align (segT seg, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
valueT mask = ((valueT) 1 << align) - 1;
return (size + mask) & ~mask;
symbol_set_frag (line_label, frag_now);
}
- if (bfd_get_section_flags (stdoutput, seg) == SEC_NO_FLAGS)
+ if (bfd_section_flags (seg) == SEC_NO_FLAGS)
{
- if (!bfd_set_section_flags (stdoutput, seg, SEC_DATA))
+ if (!bfd_set_section_flags (seg, SEC_DATA))
as_warn (_("Error setting flags for \"%s\": %s"), name,
bfd_errmsg (bfd_get_error ()));
}
S_SET_VALUE (line_label, frag_now_fix ());
}
seg_info (seg)->bss = 1; /* Uninitialised data. */
- if (!bfd_set_section_flags (stdoutput, seg, SEC_ALLOC))
+ if (!bfd_set_section_flags (seg, SEC_ALLOC))
as_warn (_("Error setting flags for \"%s\": %s"), name,
bfd_errmsg (bfd_get_error ()));
tic4x_seg_alloc (name, seg, size, line_label);
blocking_flag = alignment_flag = 0;
seg = subseg_new (name, 0);
- flags = bfd_get_section_flags (stdoutput, seg) | SEC_ALLOC;
+ flags = bfd_section_flags (seg) | SEC_ALLOC;
if (alignment_flag)
{
if (blocking_flag)
flags |= SEC_TIC54X_BLOCK;
- if (!bfd_set_section_flags (stdoutput, seg, flags))
+ if (!bfd_set_section_flags (seg, flags))
as_warn (_("Error setting flags for \"%s\": %s"), name,
bfd_errmsg (bfd_get_error ()));
emit_insn (tic54x_insn *insn)
{
int i;
- flagword oldflags = bfd_get_section_flags (stdoutput, now_seg);
+ flagword oldflags = bfd_section_flags (now_seg);
flagword flags = oldflags | SEC_CODE;
- if (! bfd_set_section_flags (stdoutput, now_seg, flags))
+ if (!bfd_set_section_flags (now_seg, flags))
as_warn (_("error setting flags for \"%s\": %s"),
- bfd_section_name (stdoutput, now_seg),
+ bfd_section_name (now_seg),
bfd_errmsg (bfd_get_error ()));
for (i = 0; i < insn->words; i++)
/* This is copied from perform_an_assembly_pass. */
applicable = bfd_applicable_section_flags (stdoutput);
- bfd_set_section_flags (stdoutput, sbss_section, applicable & SEC_ALLOC);
+ bfd_set_section_flags (sbss_section, applicable & SEC_ALLOC);
subseg_set (seg, subseg);
{
/* Round up section sizes to ensure that text sections consist of
whole fetch packets. */
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
}
as_warn (_("Could not set architecture and machine"));
/* Guarantee text section is aligned. */
- bfd_set_section_alignment (stdoutput, text_section,
+ bfd_set_section_alignment (text_section,
TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
require_canonical_reg_names = 1;
/* If the section seems to have no alignment set yet, go ahead and
make it large enough to hold code. */
- if (bfd_get_section_alignment (stdoutput, now_seg) == 0)
- bfd_set_section_alignment (stdoutput, now_seg,
+ if (bfd_section_alignment (now_seg) == 0)
+ bfd_set_section_alignment (now_seg,
TILEGX_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
for (j = 0; j < current_bundle_index; j++)
int i;
/* Guarantee text section is aligned. */
- bfd_set_section_alignment (stdoutput, text_section,
+ bfd_set_section_alignment (text_section,
TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
require_canonical_reg_names = 1;
/* If the section seems to have no alignment set yet, go ahead and
make it large enough to hold code. */
- if (bfd_get_section_alignment (stdoutput, now_seg) == 0)
- bfd_set_section_alignment (stdoutput, now_seg,
+ if (bfd_section_alignment (now_seg) == 0)
+ bfd_set_section_alignment (now_seg,
TILEPRO_LOG2_BUNDLE_ALIGNMENT_IN_BYTES);
for (j = 0; j < current_bundle_index; j++)
else
{
seg->s = subseg_new (seg->name, sub);
- bfd_set_section_flags (stdoutput, seg->s, seg->flags);
+ bfd_set_section_flags (seg->s, seg->flags);
if ((seg->flags & SEC_LOAD) == 0)
seg_info (seg->s)->bss = 1;
}
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
enum v850_notes id;
note_sec = subseg_new (V850_NOTE_SECNAME, 0);
- bfd_set_section_flags (stdoutput, note_sec, SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
- bfd_set_section_alignment (stdoutput, note_sec, 2);
+ bfd_set_section_flags (note_sec, SEC_HAS_CONTENTS | SEC_READONLY | SEC_MERGE);
+ bfd_set_section_alignment (note_sec, 2);
/* Provide default values for all of the notes. */
for (id = V850_NOTE_ALIGNMENT; id <= NUM_V850_NOTES; id++)
valueT
md_section_align (asection *seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection * seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (asection * seg, valueT addr)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
return ((addr + (1 << align) - 1) & -(1 << align));
}
valueT
md_section_align (segT segment, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, segment);
+ int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
}
{
flagword flags, link_once_flags;
- flags = bfd_get_section_flags (abfd, sec);
+ flags = bfd_section_flags (sec);
link_once_flags = (flags & SEC_LINK_ONCE);
/* Flags might not be set yet. */
segment_info_type *seginfo;
fragS *fragP;
flagword flags;
- flags = bfd_get_section_flags (stdoutput, sec);
+ flags = bfd_section_flags (sec);
if (flags & SEC_DEBUGGING)
continue;
if (!(flags & SEC_ALLOC))
segment_info_type *seginfo;
fragS *fragP;
flagword flags;
- flags = bfd_get_section_flags (stdoutput, sec);
+ flags = bfd_section_flags (sec);
if (flags & SEC_DEBUGGING)
continue;
if (!(flags & SEC_ALLOC))
asection *sec,
void *unused ATTRIBUTE_UNUSED)
{
- flagword flags = bfd_get_section_flags (abfd, sec);
+ flagword flags = bfd_section_flags (sec);
segment_info_type *seginfo = seg_info (sec);
fragS *frag = seginfo->frchainP->frch_root;
asection *sec,
void *unused ATTRIBUTE_UNUSED)
{
- flagword flags = bfd_get_section_flags (abfd, sec);
+ flagword flags = bfd_section_flags (sec);
segment_info_type *seginfo = seg_info (sec);
fragS *frag = seginfo->frchainP->frch_root;
xtensa_isa isa = xtensa_default_isa;
int sz;
info_sec = subseg_new (".xtensa.info", 0);
- bfd_set_section_flags (stdoutput, info_sec, SEC_HAS_CONTENTS | SEC_READONLY);
+ bfd_set_section_flags (info_sec, SEC_HAS_CONTENTS | SEC_READONLY);
data = XNEWVEC (char, 100);
sprintf (data, "USE_ABSOLUTE_LITERALS=%d\nABI=%d\n",
elf_group_name (seg) = group_name;
- bfd_set_section_flags (stdoutput, seg, flags);
- bfd_set_section_alignment (stdoutput, seg, 2);
+ bfd_set_section_flags (seg, flags);
+ bfd_set_section_alignment (seg, 2);
}
*pcached = seg;
num_recs++;
rec_size = num_recs * 8;
- bfd_set_section_size (stdoutput, sec, rec_size);
+ bfd_set_section_size (sec, rec_size);
if (num_recs)
{
num_recs++;
rec_size = num_recs * (8 + 4);
- bfd_set_section_size (stdoutput, sec, rec_size);
+ bfd_set_section_size (sec, rec_size);
/* elf_section_data (sec)->this_hdr.sh_entsize = 12; */
if (num_recs)
static bfd_boolean
exclude_section_from_property_tables (segT sec)
{
- flagword flags = bfd_get_section_flags (stdoutput, sec);
+ flagword flags = bfd_section_flags (sec);
/* Sections that don't contribute to the memory footprint are excluded. */
if ((flags & SEC_DEBUGGING)
valueT
md_section_align (segT seg, valueT size)
{
- int align = bfd_get_section_alignment (stdoutput, seg);
+ int align = bfd_section_alignment (seg);
valueT mask = ((valueT) 1 << align) - 1;
return (size + mask) & ~mask;
if (!seg)
return concat (base_name, NULL);
- name = bfd_get_section_name (stdoutput, seg);
+ name = bfd_section_name (seg);
if (name == NULL || *name == 0)
return concat (base_name, NULL);
if (compact_eh)
return now_seg;
- if ((bfd_get_section_flags (stdoutput, now_seg)
+ if ((bfd_section_flags (now_seg)
& (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
| SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
| SEC_LINK_DUPLICATES_SAME_CONTENTS)) != 0)
if (!cseg)
flags = 0;
else
- flags = bfd_get_section_flags (stdoutput, cseg)
- & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
- | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
- | SEC_LINK_DUPLICATES_SAME_CONTENTS);
+ flags = (bfd_section_flags (cseg)
+ & (SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD
+ | SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE
+ | SEC_LINK_DUPLICATES_SAME_CONTENTS));
/* Add standard section flags. */
flags |= sflags;
/* Apply possibly linked once flags to new generated segment, too. */
- if (!bfd_set_section_flags (stdoutput, r, flags))
+ if (!bfd_set_section_flags (r, flags))
as_bad (_("bfd_set_section_flags: %s"),
bfd_errmsg (bfd_get_error ()));
else
{
cseg = subseg_new (base, 0);
- bfd_set_section_flags (stdoutput, cseg, flags);
+ bfd_set_section_flags (cseg, flags);
}
record_alignment (cseg, align);
return cseg;
return;
if (S_GET_SEGMENT (label) != now_seg)
return;
- if (!(bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE))
+ if (!(bfd_section_flags (now_seg) & SEC_CODE))
return;
if (files_in_use == 0 && debug_type != DEBUG_DWARF2)
return;
that all of the sub-sections are merged into a proper
.debug_line section before a debugger sees them. */
- sec_name = bfd_get_section_name (stdoutput, seg);
+ sec_name = bfd_section_name (seg);
if (strcmp (sec_name, ".text") != 0)
{
name = concat (".debug_line", sec_name, (char *) NULL);
/* Create and switch to the line number section. */
line_seg = subseg_new (".debug_line", 0);
- bfd_set_section_flags (stdoutput, line_seg, SEC_READONLY | SEC_DEBUGGING);
+ bfd_set_section_flags (line_seg, SEC_READONLY | SEC_DEBUGGING);
/* For each subsection, chain the debug entries together. */
for (s = all_segs; s; s = s->next)
aranges_seg = subseg_new (".debug_aranges", 0);
str_seg = subseg_new (".debug_str", 0);
- bfd_set_section_flags (stdoutput, info_seg,
- SEC_READONLY | SEC_DEBUGGING);
- bfd_set_section_flags (stdoutput, abbrev_seg,
- SEC_READONLY | SEC_DEBUGGING);
- bfd_set_section_flags (stdoutput, aranges_seg,
- SEC_READONLY | SEC_DEBUGGING);
- bfd_set_section_flags (stdoutput, str_seg,
- (SEC_READONLY | SEC_DEBUGGING
- | SEC_MERGE | SEC_STRINGS));
+ bfd_set_section_flags (info_seg, SEC_READONLY | SEC_DEBUGGING);
+ bfd_set_section_flags (abbrev_seg, SEC_READONLY | SEC_DEBUGGING);
+ bfd_set_section_flags (aranges_seg, SEC_READONLY | SEC_DEBUGGING);
+ bfd_set_section_flags (str_seg, (SEC_READONLY | SEC_DEBUGGING
+ | SEC_MERGE | SEC_STRINGS));
str_seg->entsize = 1;
record_alignment (aranges_seg, ffs (2 * sizeof_address) - 1);
else
{
ranges_seg = subseg_new (".debug_ranges", 0);
- bfd_set_section_flags (stdoutput, ranges_seg,
- SEC_READONLY | SEC_DEBUGGING);
+ bfd_set_section_flags (ranges_seg, SEC_READONLY | SEC_DEBUGGING);
record_alignment (ranges_seg, ffs (2 * sizeof_address) - 1);
out_debug_ranges (ranges_seg);
}
&& first_proc_ptr != (proc_t *) NULL
&& local_first_lineno != (lineno_list_t *) NULL
&& ((S_GET_VALUE (first_proc_ptr->sym->as_sym)
- + bfd_get_section_vma (stdoutput,
- S_GET_SEGMENT (first_proc_ptr->sym->as_sym)))
+ + bfd_section_vma (S_GET_SEGMENT (first_proc_ptr->sym->as_sym)))
!= 0))
{
first.file = local_first_lineno->file;
else
sym_ptr->ecoff_sym.asym.value =
(S_GET_VALUE (as_sym)
- + bfd_get_section_vma (stdoutput,
- S_GET_SEGMENT (as_sym))
+ + bfd_section_vma (S_GET_SEGMENT (as_sym))
+ sym_ptr->addend);
sym_ptr->ecoff_sym.weakext = S_IS_WEAK (as_sym);
adr_sym = proc_ptr->sym->as_sym;
adr = (S_GET_VALUE (adr_sym)
- + bfd_get_section_vma (stdoutput,
- S_GET_SEGMENT (adr_sym)));
+ + bfd_section_vma (S_GET_SEGMENT (adr_sym)));
if (first)
{
/* This code used to force the adr of the very
static bfd_boolean
in_bss (void)
{
- flagword flags = bfd_get_section_flags (stdoutput, now_seg);
+ flagword flags = bfd_section_flags (now_seg);
return (flags & SEC_ALLOC) && !(flags & (SEC_LOAD | SEC_HAS_CONTENTS));
}
if ((bfd_applicable_section_flags (stdoutput) & SEC_LINK_ONCE) == 0)
as_warn (_(".linkonce is not supported for this object file format"));
- flags = bfd_get_section_flags (stdoutput, now_seg);
+ flags = bfd_section_flags (now_seg);
flags |= SEC_LINK_ONCE;
switch (type)
{
flags |= SEC_LINK_DUPLICATES_SAME_CONTENTS;
break;
}
- if (!bfd_set_section_flags (stdoutput, now_seg, flags))
+ if (!bfd_set_section_flags (now_seg, flags))
as_bad (_("bfd_set_section_flags: %s"),
bfd_errmsg (bfd_get_error ()));
}
{
bss_seg = subseg_new (".sbss", 1);
seg_info (bss_seg)->bss = 1;
- if (!bfd_set_section_flags (stdoutput, bss_seg, SEC_ALLOC))
+ if (!bfd_set_section_flags (bss_seg, SEC_ALLOC))
as_warn (_("error setting flags for \".sbss\": %s"),
bfd_errmsg (bfd_get_error ()));
}
flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_READONLY | SEC_ROM;
if (flags != SEC_NO_FLAGS)
{
- if (!bfd_set_section_flags (stdoutput, seg, flags))
+ if (!bfd_set_section_flags (seg, flags))
as_warn (_("error setting flags for \"%s\": %s"),
- bfd_section_name (stdoutput, seg),
+ bfd_section_name (seg),
bfd_errmsg (bfd_get_error ()));
}
}
p = frag_more (1);
*p = 0;
retval = seg_info (seg)->stabu.stab_string_size = 1;
- bfd_set_section_flags (stdoutput, seg, SEC_READONLY | SEC_DEBUGGING);
+ bfd_set_section_flags (seg, SEC_READONLY | SEC_DEBUGGING);
}
if (length > 0)
if (! seg_info (seg)->hadone)
{
- bfd_set_section_flags (stdoutput, seg,
+ bfd_set_section_flags (seg,
SEC_READONLY | SEC_RELOC | SEC_DEBUGGING);
#ifdef INIT_STAB_SECTION
INIT_STAB_SECTION (seg);
{
seginfo = XCNEW (segment_info_type);
seginfo->bfd_section = seg;
- bfd_set_section_userdata (stdoutput, seg, seginfo);
+ bfd_set_section_userdata (seg, seginfo);
}
}
\f
{
segT secptr;
segment_info_type *seginfo;
- const char *now_seg_name = (now_seg
- ? bfd_get_section_name (stdoutput, now_seg)
- : 0);
+ const char *now_seg_name = now_seg ? bfd_section_name (now_seg) : 0;
if (!force_new
&& now_seg_name
secptr->output_section = secptr;
seginfo = XCNEW (segment_info_type);
seginfo->bfd_section = secptr;
- bfd_set_section_userdata (stdoutput, secptr, seginfo);
+ bfd_set_section_userdata (secptr, seginfo);
}
return secptr;
}
int
subseg_text_p (segT sec)
{
- return (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) != 0;
+ return (bfd_section_flags (sec) & SEC_CODE) != 0;
}
/* Return non zero if SEC has at least one byte of data. It is
#define seg_info(sec) \
- ((segment_info_type *) bfd_get_section_userdata (stdoutput, sec))
+ ((segment_info_type *) bfd_section_userdata (sec))
extern symbolS *section_symbol (segT);
if (seg == absolute_section)
return;
- if (align > bfd_get_section_alignment (stdoutput, seg))
- bfd_set_section_alignment (stdoutput, seg, align);
+ if (align > bfd_section_alignment (seg))
+ bfd_set_section_alignment (seg, align);
}
int
if (seg == absolute_section)
return 0;
- return bfd_get_section_alignment (stdoutput, seg);
+ return bfd_section_alignment (seg);
}
/* Reset the section indices after removing the gas created sections. */
}
static void
-size_seg (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
+size_seg (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *xxx ATTRIBUTE_UNUSED)
{
flagword flags;
fragS *fragp;
else
size = 0;
- flags = bfd_get_section_flags (abfd, sec);
- if (size == 0 && bfd_get_section_size (sec) != 0 &&
+ flags = bfd_section_flags (sec);
+ if (size == 0 && bfd_section_size (sec) != 0 &&
(flags & SEC_HAS_CONTENTS) != 0)
return;
flags |= SEC_HAS_CONTENTS;
flags &= ~SEC_RELOC;
- x = bfd_set_section_flags (abfd, sec, flags);
+ x = bfd_set_section_flags (sec, flags);
gas_assert (x);
/* If permitted, allow the backend to pad out the section
newsize = size;
else
newsize = md_section_align (sec, size);
- x = bfd_set_section_size (abfd, sec, newsize);
+ x = bfd_set_section_size (sec, newsize);
gas_assert (x);
/* If the size had to be rounded up, add some padding in the last
}
static void
-write_relocs (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
+write_relocs (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
+ void *xxx ATTRIBUTE_UNUSED)
{
segment_info_type *seginfo = seg_info (sec);
unsigned int n;
if (n)
{
- flagword flags = bfd_get_section_flags (abfd, sec);
+ flagword flags = bfd_section_flags (sec);
flags |= SEC_RELOC;
- bfd_set_section_flags (abfd, sec, flags);
+ bfd_set_section_flags (sec, flags);
bfd_set_reloc (stdoutput, sec, relocs, n);
}
char *header;
struct z_stream_s *strm;
int x;
- flagword flags = bfd_get_section_flags (abfd, sec);
+ flagword flags = bfd_section_flags (sec);
unsigned int header_size, compression_header_size;
if (seginfo == NULL
|| (flags & (SEC_ALLOC | SEC_HAS_CONTENTS)) == SEC_ALLOC)
return;
- section_name = bfd_get_section_name (stdoutput, sec);
+ section_name = bfd_section_name (sec);
if (strncmp (section_name, ".debug_", 7) != 0)
return;
/* Update the section size and its name. */
bfd_update_compression_header (abfd, (bfd_byte *) header, sec);
- x = bfd_set_section_size (abfd, sec, compressed_size);
+ x = bfd_set_section_size (sec, compressed_size);
gas_assert (x);
if (!compression_header_size)
{
compressed_name = concat (".z", section_name + 1, (char *) NULL);
- bfd_section_name (stdoutput, sec) = compressed_name;
+ bfd_rename_section (sec, compressed_name);
}
}
/* Write out the frags. */
if (seginfo == NULL
- || !(bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS))
+ || !(bfd_section_flags (sec) & SEC_HAS_CONTENTS))
return;
for (f = seginfo->frchainP->frch_root;
do_not_pad_sections_to_alignment = 1;
alignment = SUB_SEGMENT_ALIGN (now_seg, frchainP);
- if ((bfd_get_section_flags (now_seg->owner, now_seg) & SEC_MERGE)
+ if ((bfd_section_flags (now_seg) & SEC_MERGE)
&& now_seg->entsize)
{
unsigned int entsize = now_seg->entsize;
s = subseg_new (name, 0);
elf_section_type (s)
= get_elf_backend_data (stdoutput)->obj_attrs_section_type;
- bfd_set_section_flags (stdoutput, s, SEC_READONLY | SEC_DATA);
+ bfd_set_section_flags (s, SEC_READONLY | SEC_DATA);
frag_now_fix ();
p = frag_more (size);
bfd_elf_set_obj_attr_contents (stdoutput, (bfd_byte *)p, size);
/* Create a GNU Build Attribute section. */
sec = subseg_new (GNU_BUILD_ATTRS_SECTION_NAME, FALSE);
elf_section_type (sec) = SHT_NOTE;
- bfd_set_section_flags (stdoutput, sec,
- SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA);
- bfd_set_section_alignment (stdoutput, sec, 2);
+ bfd_set_section_flags (sec, SEC_READONLY | SEC_HAS_CONTENTS | SEC_DATA);
+ bfd_set_section_alignment (sec, 2);
/* Work out the size of the notes that we will create,
and the relocation we should use. */
/* ...and another one to install the end address. */
create_note_reloc (sec, sym, total_size, desc2_offset, desc_reloc,
- bfd_get_section_size (bsym->section),
+ bfd_section_size (bsym->section),
note);
total_size += note_size;
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
+ * coff-pe-read.c, * coffread.c, * corelow.c, * dbxread.c,
+ * dicos-tdep.c, * dwarf2-frame.c, * dwarf2read.c, * elfread.c,
+ * exec.c, * fbsd-tdep.c, * gcore.c, * gdb_bfd.c, * gdb_bfd.h,
+ * hppa-tdep.c, * i386-cygwin-tdep.c, * i386-fbsd-tdep.c,
+ * i386-linux-tdep.c, * jit.c, * linux-tdep.c, * machoread.c,
+ * maint.c, * mdebugread.c, * minidebug.c, * mips-linux-tdep.c,
+ * mips-sde-tdep.c, * mips-tdep.c, * mipsread.c, * nto-tdep.c,
+ * objfiles.c, * objfiles.h, * osabi.c, * ppc-linux-tdep.c,
+ * ppc64-tdep.c, * record-btrace.c, * record-full.c, * remote.c,
+ * rs6000-aix-tdep.c, * rs6000-tdep.c, * s390-linux-tdep.c,
+ * s390-tdep.c, * solib-aix.c, * solib-dsbt.c, * solib-frv.c,
+ * solib-spu.c, * solib-svr4.c, * solib-target.c,
+ * spu-linux-nat.c, * spu-tdep.c, * symfile-mem.c, * symfile.c,
+ * symmisc.c, * symtab.c, * target.c, * windows-nat.c,
+ * xcoffread.c, * cli/cli-dump.c, * compile/compile-object-load.c,
+ * mi/mi-interp.c: Update throughout for bfd section macro and
+ function changes.
+ * gcore (gcore_create_callback): Use bfd_set_section_lma.
+ * spu-tdep.c (spu_overlay_new_objfile): Likewise.
+
2019-09-18 Tom Tromey <tom@tromey.com>
* NEWS: Add entry.
return 0;
}
- size_t size = bfd_section_size (abfd, sve_section);
+ size_t size = bfd_section_size (sve_section);
/* Check extended state size. */
if (size < SVE_HEADER_SIZE)
struct obj_section *osect;
ALL_OBJFILE_OSECTIONS (objfile, osect)
- if (bfd_get_section_flags (objfile->obfd,
- osect->the_bfd_section) & SEC_ALLOC)
+ if (bfd_section_flags (osect->the_bfd_section) & SEC_ALLOC)
{
bfd_vma start, size;
- start = bfd_get_section_vma (objfile->obfd, osect->the_bfd_section);
- size = bfd_get_section_size (osect->the_bfd_section);
+ start = bfd_section_vma (osect->the_bfd_section);
+ size = bfd_section_size (osect->the_bfd_section);
if (start <= vma && vma < start + size)
return osect;
gdb::byte_vector exidx_data;
if (exidx)
{
- exidx_vma = bfd_section_vma (objfile->obfd, exidx);
- exidx_data.resize (bfd_get_section_size (exidx));
+ exidx_vma = bfd_section_vma (exidx);
+ exidx_data.resize (bfd_section_size (exidx));
if (!bfd_get_section_contents (objfile->obfd, exidx,
exidx_data.data (), 0,
gdb::byte_vector extab_data;
if (extab)
{
- extab_vma = bfd_section_vma (objfile->obfd, extab);
- extab_data.resize (bfd_get_section_size (extab));
+ extab_vma = bfd_section_vma (extab);
+ extab_data.resize (bfd_section_size (extab));
if (!bfd_get_section_contents (objfile->obfd, extab,
extab_data.data (), 0,
sec = arm_obj_section_from_vma (objfile, idx);
if (sec == NULL)
continue;
- idx -= bfd_get_section_vma (objfile->obfd, sec->the_bfd_section);
+ idx -= bfd_section_vma (sec->the_bfd_section);
/* Determine address of exception table entry. */
if (val == 1)
scripts_sect = bfd_get_section_by_name (abfd, section_name);
if (scripts_sect == NULL
- || (bfd_get_section_flags (abfd, scripts_sect) & SEC_HAS_CONTENTS) == 0)
+ || (bfd_section_flags (scripts_sect) & SEC_HAS_CONTENTS) == 0)
return;
if (!bfd_get_full_section_contents (abfd, scripts_sect, &data))
char *p = (char *) data;
source_section_scripts (objfile, section_name, p,
- p + bfd_get_section_size (scripts_sect));
+ p + bfd_section_size (scripts_sect));
}
}
gdb_bfd_ref_ptr obfd (bfd_openw_or_error (filename, target, mode));
osection = bfd_make_section_anyway (obfd.get (), ".newsec");
- bfd_set_section_size (obfd.get (), osection, len);
- bfd_set_section_vma (obfd.get (), osection, vaddr);
- bfd_set_section_alignment (obfd.get (), osection, 0);
- bfd_set_section_flags (obfd.get (), osection, (SEC_HAS_CONTENTS
- | SEC_ALLOC
- | SEC_LOAD));
+ bfd_set_section_size (osection, len);
+ bfd_set_section_vma (osection, vaddr);
+ bfd_set_section_alignment (osection, 0);
+ bfd_set_section_flags (osection, (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD));
osection->entsize = 0;
if (!bfd_set_section_contents (obfd.get (), osection, buf, 0, len))
warning (_("writing dump file '%s' (%s)"), filename,
restore_section_callback (bfd *ibfd, asection *isec, void *args)
{
struct callback_data *data = (struct callback_data *) args;
- bfd_vma sec_start = bfd_section_vma (ibfd, isec);
- bfd_size_type size = bfd_section_size (ibfd, isec);
+ bfd_vma sec_start = bfd_section_vma (isec);
+ bfd_size_type size = bfd_section_size (isec);
bfd_vma sec_end = sec_start + size;
bfd_size_type sec_offset = 0;
bfd_size_type sec_load_count = size;
int ret;
/* Ignore non-loadable sections, eg. from elf files. */
- if (!(bfd_get_section_flags (ibfd, isec) & SEC_LOAD))
+ if (!(bfd_section_flags (isec) & SEC_LOAD))
return;
/* Does the section overlap with the desired restore range? */
{
/* No, no useable data in this section. */
printf_filtered (_("skipping section %s...\n"),
- bfd_section_name (ibfd, isec));
+ bfd_section_name (isec));
return;
}
bfd_errmsg (bfd_get_error ()));
printf_filtered ("Restoring section %s (0x%lx to 0x%lx)",
- bfd_section_name (ibfd, isec),
+ bfd_section_name (isec),
(unsigned long) sec_start,
(unsigned long) sec_end);
bfd_get_section_vma() within memory. Store the offset. */
sections[sectix].vma_offset
- = bfd_get_section_vma (abfd, sectp) - sections[sectix].rva_start;
+ = bfd_section_vma (sectp) - sections[sectix].rva_start;
}
}
\f
const char *name;
csi = (struct coff_symfile_info *) csip;
- name = bfd_get_section_name (abfd, sectp);
+ name = bfd_section_name (sectp);
if (strcmp (name, ".text") == 0)
{
- csi->textaddr = bfd_section_vma (abfd, sectp);
- csi->textsize += bfd_section_size (abfd, sectp);
+ csi->textaddr = bfd_section_vma (sectp);
+ csi->textsize += bfd_section_size (sectp);
}
else if (startswith (name, ".text"))
{
- csi->textsize += bfd_section_size (abfd, sectp);
+ csi->textsize += bfd_section_size (sectp);
}
else if (strcmp (name, ".stabstr") == 0)
{
args.resultp = §
bfd_map_over_sections (abfd, find_targ_sec, &args);
if (sect != NULL)
- addr = bfd_get_section_vma (abfd, sect);
+ addr = bfd_section_vma (sect);
return addr;
}
bfd_get_section_contents? */
bfd_seek (abfd, abfd->where, 0);
- stabstrsize = bfd_section_size (abfd, info->stabstrsect);
+ stabstrsize = bfd_section_size (info->stabstrsect);
coffstab_build_psymtabs (objfile,
info->textaddr, info->textsize,
if (sect->output_section == NULL)
sect->output_section = sect;
- if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
return;
/* Make the memory always readable. */
prot = GDB_MMAP_PROT_READ;
- if ((bfd_get_section_flags (abfd, sect) & SEC_READONLY) == 0)
+ if ((bfd_section_flags (sect) & SEC_READONLY) == 0)
prot |= GDB_MMAP_PROT_WRITE;
- if ((bfd_get_section_flags (abfd, sect) & SEC_CODE) != 0)
+ if ((bfd_section_flags (sect) & SEC_CODE) != 0)
prot |= GDB_MMAP_PROT_EXEC;
if (compile_debug)
fprintf_unfiltered (gdb_stdlog,
"module \"%s\" section \"%s\" size %s prot %u\n",
bfd_get_filename (abfd),
- bfd_get_section_name (abfd, sect),
+ bfd_section_name (sect),
paddress (target_gdbarch (),
- bfd_get_section_size (sect)),
+ bfd_section_size (sect)),
prot);
}
else
prot = -1;
if (sect == NULL
- || (data->last_prot != prot && bfd_get_section_size (sect) != 0))
+ || (data->last_prot != prot && bfd_section_size (sect) != 0))
{
CORE_ADDR addr;
asection *sect_iter;
for (sect_iter = data->last_section_first; sect_iter != sect;
sect_iter = sect_iter->next)
- if ((bfd_get_section_flags (abfd, sect_iter) & SEC_ALLOC) != 0)
- bfd_set_section_vma (abfd, sect_iter,
- addr + bfd_get_section_vma (abfd, sect_iter));
+ if ((bfd_section_flags (sect_iter) & SEC_ALLOC) != 0)
+ bfd_set_section_vma (sect_iter, addr + bfd_section_vma (sect_iter));
data->last_size = 0;
data->last_section_first = sect;
if (sect == NULL)
return;
- alignment = ((CORE_ADDR) 1) << bfd_get_section_alignment (abfd, sect);
+ alignment = ((CORE_ADDR) 1) << bfd_section_alignment (sect);
data->last_max_alignment = std::max (data->last_max_alignment, alignment);
data->last_size = (data->last_size + alignment - 1) & -alignment;
- bfd_set_section_vma (abfd, sect, data->last_size);
+ bfd_set_section_vma (sect, data->last_size);
- data->last_size += bfd_get_section_size (sect);
+ data->last_size += bfd_section_size (sect);
data->last_size = (data->last_size + alignment - 1) & -alignment;
}
bfd_vma address)
{
warning (_("Compiled module \"%s\" section \"%s\": warning: %s"),
- bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
+ bfd_get_filename (abfd), bfd_section_name (section),
xwarning);
}
{
warning (_("Cannot resolve relocation to \"%s\" "
"from compiled module \"%s\" section \"%s\"."),
- name, bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
+ name, bfd_get_filename (abfd), bfd_section_name (section));
}
/* Helper for link_callbacks callbacks vector. */
{
warning (_("Compiled module \"%s\" section \"%s\": dangerous "
"relocation: %s\n"),
- bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
+ bfd_get_filename (abfd), bfd_section_name (section),
message);
}
{
warning (_("Compiled module \"%s\" section \"%s\": unattached "
"relocation: %s\n"),
- bfd_get_filename (abfd), bfd_get_section_name (abfd, section),
+ bfd_get_filename (abfd), bfd_section_name (section),
name);
}
struct bfd_link_order link_order;
CORE_ADDR inferior_addr;
- if ((bfd_get_section_flags (abfd, sect) & (SEC_ALLOC | SEC_LOAD))
+ if ((bfd_section_flags (sect) & (SEC_ALLOC | SEC_LOAD))
!= (SEC_ALLOC | SEC_LOAD))
return;
- if (bfd_get_section_size (sect) == 0)
+ if (bfd_section_size (sect) == 0)
return;
/* Mostly a copy of bfd_simple_get_relocated_section_contents which GDB
link_order.next = NULL;
link_order.type = bfd_indirect_link_order;
link_order.offset = 0;
- link_order.size = bfd_get_section_size (sect);
+ link_order.size = bfd_section_size (sect);
link_order.u.indirect.section = sect;
gdb::unique_xmalloc_ptr<gdb_byte> sect_data
- ((bfd_byte *) xmalloc (bfd_get_section_size (sect)));
+ ((bfd_byte *) xmalloc (bfd_section_size (sect)));
sect_data_got = bfd_get_relocated_section_contents (abfd, &link_info,
&link_order,
if (sect_data_got == NULL)
error (_("Cannot map compiled module \"%s\" section \"%s\": %s"),
- bfd_get_filename (abfd), bfd_get_section_name (abfd, sect),
+ bfd_get_filename (abfd), bfd_section_name (sect),
bfd_errmsg (bfd_get_error ()));
gdb_assert (sect_data_got == sect_data.get ());
- inferior_addr = bfd_get_section_vma (abfd, sect);
+ inferior_addr = bfd_section_vma (sect);
if (0 != target_write_memory (inferior_addr, sect_data.get (),
- bfd_get_section_size (sect)))
+ bfd_section_size (sect)))
error (_("Cannot write compiled module \"%s\" section \"%s\" "
"to inferior memory range %s-%s."),
- bfd_get_filename (abfd), bfd_get_section_name (abfd, sect),
+ bfd_get_filename (abfd), bfd_section_name (sect),
paddress (target_gdbarch (), inferior_addr),
paddress (target_gdbarch (),
- inferior_addr + bfd_get_section_size (sect)));
+ inferior_addr + bfd_section_size (sect)));
}
/* Fetch the type of COMPILE_I_EXPR_PTR_TYPE and COMPILE_I_EXPR_VAL
bool fake_pid_p = false;
struct inferior *inf;
- if (!startswith (bfd_section_name (abfd, asect), ".reg/"))
+ if (!startswith (bfd_section_name (asect), ".reg/"))
return;
- core_tid = atoi (bfd_section_name (abfd, asect) + 5);
+ core_tid = atoi (bfd_section_name (asect) + 5);
pid = bfd_core_file_pid (core_bfd);
if (pid == 0)
return;
}
- size = bfd_section_size (core_bfd, section);
+ size = bfd_section_size (section);
if (size < section_min_size)
{
warning (_("Section `%s' in core file too small."),
gdb_assert (m_core_vec != nullptr);
m_core_vec->core_read_registers (regcache, contents, size, which,
- ((CORE_ADDR)
- bfd_section_vma (core_bfd, section)));
+ (CORE_ADDR) bfd_section_vma (section));
}
/* Data passed to gdbarch_iterate_over_regset_sections's callback. */
= bfd_big_endian (abfd) ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
int fd, pos = 0;
- sscanf (bfd_section_name (abfd, asect), "SPU/%d/regs%n", &fd, &pos);
+ sscanf (bfd_section_name (asect), "SPU/%d/regs%n", &fd, &pos);
if (pos == 0)
return;
if (section == NULL)
return TARGET_XFER_E_IO;
- size = bfd_section_size (core_bfd, section);
+ size = bfd_section_size (section);
if (offset >= size)
return TARGET_XFER_EOF;
size -= offset;
if (section == NULL)
return TARGET_XFER_E_IO;
- size = bfd_section_size (core_bfd, section);
+ size = bfd_section_size (section);
if (offset >= size)
return TARGET_XFER_EOF;
size -= offset;
if (section == NULL)
return TARGET_XFER_E_IO;
- size = bfd_section_size (core_bfd, section);
+ size = bfd_section_size (section);
if (offset >= size)
return TARGET_XFER_EOF;
size -= offset;
CORE_ADDR end = 0;
for (sec = sym_bfd->sections; sec; sec = sec->next)
- if (bfd_get_section_flags (sym_bfd, sec) & SEC_CODE)
+ if (bfd_section_flags (sec) & SEC_CODE)
{
- CORE_ADDR sec_start = bfd_section_vma (sym_bfd, sec);
- CORE_ADDR sec_end = sec_start + bfd_section_size (sym_bfd, sec);
+ CORE_ADDR sec_start = bfd_section_vma (sec);
+ CORE_ADDR sec_end = sec_start + bfd_section_size (sec);
if (found_any)
{
text_sect = bfd_get_section_by_name (sym_bfd, ".text");
if (!text_sect)
error (_("Can't find .text section in symbol file"));
- DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
- DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
+ DBX_TEXT_ADDR (objfile) = bfd_section_vma (text_sect);
+ DBX_TEXT_SIZE (objfile) = bfd_section_size (text_sect);
DBX_SYMBOL_SIZE (objfile) = obj_symbol_entry_size (sym_bfd);
DBX_SYMCOUNT (objfile) = bfd_get_symcount (sym_bfd);
if (bfd_seek (sym_bfd, filepos, SEEK_SET) != 0)
perror_with_name (bfd_get_filename (sym_bfd));
- symbuf_left = bfd_section_size (sym_bfd, (*symbuf_sections)[sect_idx]);
+ symbuf_left = bfd_section_size ((*symbuf_sections)[sect_idx]);
symbol_table_offset = filepos - symbuf_read;
++sect_idx;
}
= make_scoped_restore (&symbuf_sections);
if (stabsects.size () == 1)
{
- stabsize = bfd_section_size (sym_bfd, stabsects[0]);
+ stabsize = bfd_section_size (stabsects[0]);
DBX_SYMCOUNT (objfile) = stabsize / DBX_SYMBOL_SIZE (objfile);
DBX_SYMTAB_OFFSET (objfile) = stabsects[0]->filepos;
}
DBX_SYMCOUNT (objfile) = 0;
for (asection *section : stabsects)
{
- stabsize = bfd_section_size (sym_bfd, section);
+ stabsize = bfd_section_size (section);
DBX_SYMCOUNT (objfile) += stabsize / DBX_SYMBOL_SIZE (objfile);
}
sect_idx = 1;
symbuf_sections = &stabsects;
- symbuf_left = bfd_section_size (sym_bfd, stabsects[0]);
+ symbuf_left = bfd_section_size (stabsects[0]);
symbuf_read = 0;
}
#define ELF_STABS_SYMBOL_SIZE 12 /* XXX FIXME XXX */
DBX_SYMBOL_SIZE (objfile) = ELF_STABS_SYMBOL_SIZE;
DBX_SYMCOUNT (objfile)
- = bfd_section_size (objfile->obfd, stabsect) / DBX_SYMBOL_SIZE (objfile);
+ = bfd_section_size (stabsect) / DBX_SYMBOL_SIZE (objfile);
DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos;
DBX_STAB_SECTION (objfile) = stabsect;
processing_acc_compilation = 1;
symbuf_read = 0;
- symbuf_left = bfd_section_size (objfile->obfd, stabsect);
+ symbuf_left = bfd_section_size (stabsect);
scoped_restore restore_stabs_data = make_scoped_restore (&stabs_data);
gdb::unique_xmalloc_ptr<gdb_byte> data_holder;
text_sect = bfd_get_section_by_name (sym_bfd, text_name);
if (!text_sect)
error (_("Can't find %s section in symbol file"), text_name);
- DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
- DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
+ DBX_TEXT_ADDR (objfile) = bfd_section_vma (text_sect);
+ DBX_TEXT_SIZE (objfile) = bfd_section_size (text_sect);
DBX_SYMBOL_SIZE (objfile) = sizeof (struct external_nlist);
- DBX_SYMCOUNT (objfile) = bfd_section_size (sym_bfd, stabsect)
+ DBX_SYMCOUNT (objfile) = bfd_section_size (stabsect)
/ DBX_SYMBOL_SIZE (objfile);
- DBX_STRINGTAB_SIZE (objfile) = bfd_section_size (sym_bfd, stabstrsect);
+ DBX_STRINGTAB_SIZE (objfile) = bfd_section_size (stabstrsect);
DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos; /* XXX - FIXME: POKING
INSIDE BFD DATA
STRUCTURES */
if (!section)
return 0;
- if (bfd_section_size (abfd, section) != header_size)
+ if (bfd_section_size (section) != header_size)
return 0;
/* Dicos LMs always have a "Dicos_loadModuleInfo" symbol
base = 0;
break;
case DW_EH_PE_pcrel:
- base = bfd_get_section_vma (unit->abfd, unit->dwarf_frame_section);
+ base = bfd_section_vma (unit->dwarf_frame_section);
base += (buf - unit->dwarf_frame_buffer);
break;
case DW_EH_PE_datarel:
asection *sectp = get_section_bfd_section (section);
gdb_assert (sectp != NULL);
- return bfd_section_name (get_section_bfd_owner (section), sectp);
+ return bfd_section_name (sectp);
}
/* Return the name of the file SECTION is in. */
asection *sectp = get_section_bfd_section (section);
gdb_assert (sectp != NULL);
- return bfd_get_section_flags (sectp->owner, sectp);
+ return bfd_section_flags (sectp);
}
/* When loading sections, we look either for uncompressed section or for
dwarf2_per_objfile::locate_sections (bfd *abfd, asection *sectp,
const dwarf2_debug_sections &names)
{
- flagword aflag = bfd_get_section_flags (abfd, sectp);
+ flagword aflag = bfd_section_flags (sectp);
if ((aflag & SEC_HAS_CONTENTS) == 0)
{
else if (section_is_p (sectp->name, &names.info))
{
this->info.s.section = sectp;
- this->info.size = bfd_get_section_size (sectp);
+ this->info.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.abbrev))
{
this->abbrev.s.section = sectp;
- this->abbrev.size = bfd_get_section_size (sectp);
+ this->abbrev.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.line))
{
this->line.s.section = sectp;
- this->line.size = bfd_get_section_size (sectp);
+ this->line.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.loc))
{
this->loc.s.section = sectp;
- this->loc.size = bfd_get_section_size (sectp);
+ this->loc.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.loclists))
{
this->loclists.s.section = sectp;
- this->loclists.size = bfd_get_section_size (sectp);
+ this->loclists.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.macinfo))
{
this->macinfo.s.section = sectp;
- this->macinfo.size = bfd_get_section_size (sectp);
+ this->macinfo.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.macro))
{
this->macro.s.section = sectp;
- this->macro.size = bfd_get_section_size (sectp);
+ this->macro.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.str))
{
this->str.s.section = sectp;
- this->str.size = bfd_get_section_size (sectp);
+ this->str.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.line_str))
{
this->line_str.s.section = sectp;
- this->line_str.size = bfd_get_section_size (sectp);
+ this->line_str.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.addr))
{
this->addr.s.section = sectp;
- this->addr.size = bfd_get_section_size (sectp);
+ this->addr.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.frame))
{
this->frame.s.section = sectp;
- this->frame.size = bfd_get_section_size (sectp);
+ this->frame.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.eh_frame))
{
this->eh_frame.s.section = sectp;
- this->eh_frame.size = bfd_get_section_size (sectp);
+ this->eh_frame.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.ranges))
{
this->ranges.s.section = sectp;
- this->ranges.size = bfd_get_section_size (sectp);
+ this->ranges.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.rnglists))
{
this->rnglists.s.section = sectp;
- this->rnglists.size = bfd_get_section_size (sectp);
+ this->rnglists.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.types))
{
memset (&type_section, 0, sizeof (type_section));
type_section.s.section = sectp;
- type_section.size = bfd_get_section_size (sectp);
+ type_section.size = bfd_section_size (sectp);
this->types.push_back (type_section);
}
else if (section_is_p (sectp->name, &names.gdb_index))
{
this->gdb_index.s.section = sectp;
- this->gdb_index.size = bfd_get_section_size (sectp);
+ this->gdb_index.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.debug_names))
{
this->debug_names.s.section = sectp;
- this->debug_names.size = bfd_get_section_size (sectp);
+ this->debug_names.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names.debug_aranges))
{
this->debug_aranges.s.section = sectp;
- this->debug_aranges.size = bfd_get_section_size (sectp);
+ this->debug_aranges.size = bfd_section_size (sectp);
}
- if ((bfd_get_section_flags (abfd, sectp) & (SEC_LOAD | SEC_ALLOC))
- && bfd_section_vma (abfd, sectp) == 0)
+ if ((bfd_section_flags (sectp) & (SEC_LOAD | SEC_ALLOC))
+ && bfd_section_vma (sectp) == 0)
this->has_section_at_zero = true;
}
{
error (_("Dwarf Error: Can't read DWARF data"
" in section %s [in module %s]"),
- bfd_section_name (abfd, sectp), bfd_get_filename (abfd));
+ bfd_section_name (sectp), bfd_get_filename (abfd));
}
}
if (section_is_p (sectp->name, &dwarf2_elf_names.abbrev))
{
dwz_file->abbrev.s.section = sectp;
- dwz_file->abbrev.size = bfd_get_section_size (sectp);
+ dwz_file->abbrev.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &dwarf2_elf_names.info))
{
dwz_file->info.s.section = sectp;
- dwz_file->info.size = bfd_get_section_size (sectp);
+ dwz_file->info.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &dwarf2_elf_names.str))
{
dwz_file->str.s.section = sectp;
- dwz_file->str.size = bfd_get_section_size (sectp);
+ dwz_file->str.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &dwarf2_elf_names.line))
{
dwz_file->line.s.section = sectp;
- dwz_file->line.size = bfd_get_section_size (sectp);
+ dwz_file->line.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &dwarf2_elf_names.macro))
{
dwz_file->macro.s.section = sectp;
- dwz_file->macro.size = bfd_get_section_size (sectp);
+ dwz_file->macro.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &dwarf2_elf_names.gdb_index))
{
dwz_file->gdb_index.s.section = sectp;
- dwz_file->gdb_index.size = bfd_get_section_size (sectp);
+ dwz_file->gdb_index.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &dwarf2_elf_names.debug_names))
{
dwz_file->debug_names.s.section = sectp;
- dwz_file->debug_names.size = bfd_get_section_size (sectp);
+ dwz_file->debug_names.size = bfd_section_size (sectp);
}
}
if (sections->abbrev.s.section != NULL)
return 0;
sections->abbrev.s.section = sectp;
- sections->abbrev.size = bfd_get_section_size (sectp);
+ sections->abbrev.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->info_dwo)
|| section_is_p (sectp->name, &names->types_dwo))
if (sections->info_or_types.s.section != NULL)
return 0;
sections->info_or_types.s.section = sectp;
- sections->info_or_types.size = bfd_get_section_size (sectp);
+ sections->info_or_types.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->line_dwo))
{
if (sections->line.s.section != NULL)
return 0;
sections->line.s.section = sectp;
- sections->line.size = bfd_get_section_size (sectp);
+ sections->line.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->loc_dwo))
{
if (sections->loc.s.section != NULL)
return 0;
sections->loc.s.section = sectp;
- sections->loc.size = bfd_get_section_size (sectp);
+ sections->loc.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->macinfo_dwo))
{
if (sections->macinfo.s.section != NULL)
return 0;
sections->macinfo.s.section = sectp;
- sections->macinfo.size = bfd_get_section_size (sectp);
+ sections->macinfo.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->macro_dwo))
{
if (sections->macro.s.section != NULL)
return 0;
sections->macro.s.section = sectp;
- sections->macro.size = bfd_get_section_size (sectp);
+ sections->macro.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->str_offsets_dwo))
{
if (sections->str_offsets.s.section != NULL)
return 0;
sections->str_offsets.s.section = sectp;
- sections->str_offsets.size = bfd_get_section_size (sectp);
+ sections->str_offsets.size = bfd_section_size (sectp);
}
else
{
bounds of the real section. This is a pretty-rare event, so just
flag an error (easier) instead of a warning and trying to cope. */
if (sectp == NULL
- || offset + size > bfd_get_section_size (sectp))
+ || offset + size > bfd_section_size (sectp))
{
error (_("Dwarf Error: Bad DWP V2 section info, doesn't fit"
" in section %s [in module %s]"),
- sectp ? bfd_section_name (abfd, sectp) : "<unknown>",
+ sectp ? bfd_section_name (sectp) : "<unknown>",
objfile_name (dwarf2_per_objfile->objfile));
}
if (section_is_p (sectp->name, &names->abbrev_dwo))
{
dwo_sections->abbrev.s.section = sectp;
- dwo_sections->abbrev.size = bfd_get_section_size (sectp);
+ dwo_sections->abbrev.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->info_dwo))
{
dwo_sections->info.s.section = sectp;
- dwo_sections->info.size = bfd_get_section_size (sectp);
+ dwo_sections->info.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->line_dwo))
{
dwo_sections->line.s.section = sectp;
- dwo_sections->line.size = bfd_get_section_size (sectp);
+ dwo_sections->line.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->loc_dwo))
{
dwo_sections->loc.s.section = sectp;
- dwo_sections->loc.size = bfd_get_section_size (sectp);
+ dwo_sections->loc.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->macinfo_dwo))
{
dwo_sections->macinfo.s.section = sectp;
- dwo_sections->macinfo.size = bfd_get_section_size (sectp);
+ dwo_sections->macinfo.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->macro_dwo))
{
dwo_sections->macro.s.section = sectp;
- dwo_sections->macro.size = bfd_get_section_size (sectp);
+ dwo_sections->macro.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->str_dwo))
{
dwo_sections->str.s.section = sectp;
- dwo_sections->str.size = bfd_get_section_size (sectp);
+ dwo_sections->str.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->str_offsets_dwo))
{
dwo_sections->str_offsets.s.section = sectp;
- dwo_sections->str_offsets.size = bfd_get_section_size (sectp);
+ dwo_sections->str_offsets.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->types_dwo))
{
memset (&type_section, 0, sizeof (type_section));
type_section.s.section = sectp;
- type_section.size = bfd_get_section_size (sectp);
+ type_section.size = bfd_section_size (sectp);
dwo_sections->types.push_back (type_section);
}
}
if (section_is_p (sectp->name, &names->str_dwo))
{
dwp_file->sections.str.s.section = sectp;
- dwp_file->sections.str.size = bfd_get_section_size (sectp);
+ dwp_file->sections.str.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->cu_index))
{
dwp_file->sections.cu_index.s.section = sectp;
- dwp_file->sections.cu_index.size = bfd_get_section_size (sectp);
+ dwp_file->sections.cu_index.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->tu_index))
{
dwp_file->sections.tu_index.s.section = sectp;
- dwp_file->sections.tu_index.size = bfd_get_section_size (sectp);
+ dwp_file->sections.tu_index.size = bfd_section_size (sectp);
}
}
if (section_is_p (sectp->name, &names->abbrev_dwo))
{
dwp_file->sections.abbrev.s.section = sectp;
- dwp_file->sections.abbrev.size = bfd_get_section_size (sectp);
+ dwp_file->sections.abbrev.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->info_dwo))
{
dwp_file->sections.info.s.section = sectp;
- dwp_file->sections.info.size = bfd_get_section_size (sectp);
+ dwp_file->sections.info.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->line_dwo))
{
dwp_file->sections.line.s.section = sectp;
- dwp_file->sections.line.size = bfd_get_section_size (sectp);
+ dwp_file->sections.line.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->loc_dwo))
{
dwp_file->sections.loc.s.section = sectp;
- dwp_file->sections.loc.size = bfd_get_section_size (sectp);
+ dwp_file->sections.loc.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->macinfo_dwo))
{
dwp_file->sections.macinfo.s.section = sectp;
- dwp_file->sections.macinfo.size = bfd_get_section_size (sectp);
+ dwp_file->sections.macinfo.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->macro_dwo))
{
dwp_file->sections.macro.s.section = sectp;
- dwp_file->sections.macro.size = bfd_get_section_size (sectp);
+ dwp_file->sections.macro.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->str_offsets_dwo))
{
dwp_file->sections.str_offsets.s.section = sectp;
- dwp_file->sections.str_offsets.size = bfd_get_section_size (sectp);
+ dwp_file->sections.str_offsets.size = bfd_section_size (sectp);
}
else if (section_is_p (sectp->name, &names->types_dwo))
{
dwp_file->sections.types.s.section = sectp;
- dwp_file->sections.types.size = bfd_get_section_size (sectp);
+ dwp_file->sections.types.size = bfd_section_size (sectp);
}
}
{
int j;
- if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
continue;
Elf_Internal_Shdr *this_hdr = &elf_section_data (sect)->this_hdr;
RealView) use SHT_NOBITS for uninitialized data. Since it is
uninitialized, it doesn't need a program header. Such
binaries are not relocatable. */
- if (bfd_get_section_size (sect) > 0 && j == num_segments
- && (bfd_get_section_flags (abfd, sect) & SEC_LOAD) != 0)
+ if (bfd_section_size (sect) > 0 && j == num_segments
+ && (bfd_section_flags (sect) & SEC_LOAD) != 0)
warning (_("Loadable section \"%s\" outside of ELF segments"),
- bfd_section_name (abfd, sect));
+ bfd_section_name (sect));
}
return data;
covers the stub's address. */
for (sect = abfd->sections; sect != NULL; sect = sect->next)
{
- if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
continue;
- if (symaddr >= bfd_get_section_vma (abfd, sect)
- && symaddr < bfd_get_section_vma (abfd, sect)
- + bfd_get_section_size (sect))
+ if (symaddr >= bfd_section_vma (sect)
+ && symaddr < bfd_section_vma (sect)
+ + bfd_section_size (sect))
break;
}
if (!sect)
if (section == NULL)
return false;
- return (bfd_get_section_vma (obfd, section) <= address
- && (address < bfd_get_section_vma (obfd, section)
- + bfd_get_section_size (section)));
+ return (bfd_section_vma (section) <= address
+ && (address < bfd_section_vma (section)
+ + bfd_section_size (section)));
};
reloc_count = relplt->size / elf_section_data (relplt)->this_hdr.sh_entsize;
elfstab_build_psymtabs (objfile,
ei.stabsect,
str_sect->filepos,
- bfd_section_size (abfd, str_sect));
+ bfd_section_size (str_sect));
}
if (dwarf2_has_info (objfile, NULL))
encountered on sparc-solaris 2.10 a shared library with an empty .bss
section to which a symbol named "_end" was attached. The address
of this symbol still needs to be relocated. */
- aflag = bfd_get_section_flags (abfd, asect);
+ aflag = bfd_section_flags (asect);
if (!(aflag & SEC_ALLOC))
return;
(*table_pp)->owner = NULL;
(*table_pp)->the_bfd_section = asect;
- (*table_pp)->addr = bfd_section_vma (abfd, asect);
- (*table_pp)->endaddr = (*table_pp)->addr + bfd_section_size (abfd, asect);
+ (*table_pp)->addr = bfd_section_vma (asect);
+ (*table_pp)->endaddr = (*table_pp)->addr + bfd_section_size (asect);
(*table_pp)++;
}
/* Compute the number of sections to add. */
ALL_OBJFILE_OSECTIONS (objfile, osect)
{
- if (bfd_get_section_size (osect->the_bfd_section) == 0)
+ if (bfd_section_size (osect->the_bfd_section) == 0)
continue;
count++;
}
ALL_OBJFILE_OSECTIONS (objfile, osect)
{
- if (bfd_get_section_size (osect->the_bfd_section) == 0)
+ if (bfd_section_size (osect->the_bfd_section) == 0)
continue;
gdb_assert (ts < table->sections + space + count);
continue;
vma = s->vma;
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
if (vma <= offset && offset < (vma + size))
{
ULONGEST amt;
for (target_section *p = sections; p < sections_end; p++)
{
- if ((bfd_get_section_flags (p->the_bfd_section->owner,
- p->the_bfd_section)
- & SEC_READONLY) == 0)
+ if ((bfd_section_flags (p->the_bfd_section) & SEC_READONLY) == 0)
continue;
/* Copy the meta-data, adjusted. */
for (p = t->sections; p < t->sections_end; p++)
{
struct bfd_section *psect = p->the_bfd_section;
- bfd *pbfd = psect->owner;
- if ((bfd_get_section_flags (pbfd, psect) & (SEC_ALLOC | SEC_LOAD))
+ if ((bfd_section_flags (psect) & (SEC_ALLOC | SEC_LOAD))
!= (SEC_ALLOC | SEC_LOAD))
continue;
- if (bfd_get_section_vma (pbfd, psect) <= abfd->start_address
- && abfd->start_address < (bfd_get_section_vma (pbfd, psect)
- + bfd_get_section_size (psect)))
+ if (bfd_section_vma (psect) <= abfd->start_address
+ && abfd->start_address < (bfd_section_vma (psect)
+ + bfd_section_size (psect)))
{
- displacement = p->addr - bfd_get_section_vma (pbfd, psect);
+ displacement = p->addr - bfd_section_vma (psect);
break;
}
}
if (info_verbose)
printf_filtered (" @ %s",
hex_string_custom (psect->filepos, 8));
- printf_filtered (" is %s", bfd_section_name (pbfd, psect));
+ printf_filtered (" is %s", bfd_section_name (psect));
if (pbfd != abfd)
printf_filtered (" in %s", bfd_get_filename (pbfd));
printf_filtered ("\n");
table = current_target_sections;
for (p = table->sections; p < table->sections_end; p++)
{
- if (!strncmp (secname, bfd_section_name (p->bfd,
- p->the_bfd_section), seclen)
- && bfd_section_name (p->bfd, p->the_bfd_section)[seclen] == '\0')
+ if (!strncmp (secname, bfd_section_name (p->the_bfd_section), seclen)
+ && bfd_section_name (p->the_bfd_section)[seclen] == '\0')
{
offset = secaddr - p->addr;
p->addr += offset;
thread_section_name section_name (".thrmisc", thr->ptid);
section = bfd_get_section_by_name (core_bfd, section_name.c_str ());
- if (section != NULL && bfd_section_size (core_bfd, section) > 0)
+ if (section != NULL && bfd_section_size (section) > 0)
{
/* Truncate the name if it is longer than "buf". */
- size = bfd_section_size (core_bfd, section);
+ size = bfd_section_size (section);
if (size > sizeof buf - 1)
size = sizeof buf - 1;
if (bfd_get_section_contents (core_bfd, section, buf, (file_ptr) 0,
return;
}
- size_t note_size = bfd_get_section_size (section);
+ size_t note_size = bfd_section_size (section);
if (note_size < 4)
error (_("malformed core note - too short for header"));
return;
}
- note_size = bfd_get_section_size (section);
+ note_size = bfd_section_size (section);
if (note_size < 4)
error (_("malformed core note - too short for header"));
if (section == NULL)
return nullptr;
- note_size = bfd_get_section_size (section);
+ note_size = bfd_section_size (section);
if (note_size < 4)
error (_("malformed core note - too short for header"));
* structure size, then it must be long enough to access the last
* field used (ki_rusage_ch.ru_majflt) which is the size of a long.
*/
- note_size = bfd_get_section_size (section);
+ note_size = bfd_section_size (section);
if (note_size < (4 + kp->ki_rusage_ch + kp->ru_majflt
+ long_bit / TARGET_CHAR_BIT))
error (_("malformed core note - too short"));
error (_("Failed to create 'note' section for corefile: %s"),
bfd_errmsg (bfd_get_error ()));
- bfd_set_section_vma (obfd, note_sec, 0);
- bfd_set_section_alignment (obfd, note_sec, 0);
- bfd_set_section_size (obfd, note_sec, note_size);
+ bfd_set_section_vma (note_sec, 0);
+ bfd_set_section_alignment (note_sec, 0);
+ bfd_set_section_size (note_sec, note_size);
/* Now create the memory/load sections. */
if (gcore_memory_sections (obfd) == 0)
for (sec = abfd->sections; sec; sec = sec->next)
{
- if (bfd_get_section_flags (abfd, sec) & SEC_DATA
- || strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
+ if (bfd_section_flags (sec) & SEC_DATA
+ || strcmp (".bss", bfd_section_name (sec)) == 0)
{
- sec_vaddr = bfd_get_section_vma (abfd, sec);
- sec_size = bfd_get_section_size (sec);
+ sec_vaddr = bfd_section_vma (sec);
+ sec_size = bfd_section_size (sec);
if (sec_vaddr + sec_size > top_of_data_memory)
top_of_data_memory = sec_vaddr + sec_size;
}
int p_type = 0;
/* FIXME: these constants may only be applicable for ELF. */
- if (startswith (bfd_section_name (obfd, osec), "load"))
+ if (startswith (bfd_section_name (osec), "load"))
p_type = PT_LOAD;
- else if (startswith (bfd_section_name (obfd, osec), "note"))
+ else if (startswith (bfd_section_name (osec), "note"))
p_type = PT_NOTE;
else
p_type = PT_NULL;
p_flags |= PF_R; /* Segment is readable. */
- if (!(bfd_get_section_flags (obfd, osec) & SEC_READONLY))
+ if (!(bfd_section_flags (osec) & SEC_READONLY))
p_flags |= PF_W; /* Segment is writable. */
- if (bfd_get_section_flags (obfd, osec) & SEC_CODE)
+ if (bfd_section_flags (osec) & SEC_CODE)
p_flags |= PF_X; /* Segment is executable. */
bfd_record_phdr (obfd, p_type, 1, p_flags, 0, 0, 0, 0, 1, &osec);
{
bfd *abfd = objfile->obfd;
asection *asec = objsec->the_bfd_section;
- bfd_vma align = (bfd_vma) 1 << bfd_get_section_alignment (abfd,
- asec);
+ bfd_vma align = (bfd_vma) 1 << bfd_section_alignment (asec);
bfd_vma start = obj_section_addr (objsec) & -align;
bfd_vma end = (obj_section_endaddr (objsec) + align - 1) & -align;
plongest (size), paddress (target_gdbarch (), vaddr));
}
- bfd_set_section_size (obfd, osec, size);
- bfd_set_section_vma (obfd, osec, vaddr);
- bfd_section_lma (obfd, osec) = 0; /* ??? bfd_set_section_lma? */
+ bfd_set_section_size (osec, size);
+ bfd_set_section_vma (osec, vaddr);
+ bfd_set_section_lma (osec, 0);
return 0;
}
for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, objsec)
{
- bfd *ibfd = objfile->obfd;
asection *isec = objsec->the_bfd_section;
- flagword flags = bfd_get_section_flags (ibfd, isec);
+ flagword flags = bfd_section_flags (isec);
/* Separate debug info files are irrelevant for gcore. */
if (objfile->separate_debug_objfile_backlink != NULL)
if ((flags & SEC_ALLOC) || (flags & SEC_LOAD))
{
- int size = bfd_section_size (ibfd, isec);
+ int size = bfd_section_size (isec);
int ret;
ret = (*func) (obj_section_addr (objsec), size,
static void
gcore_copy_callback (bfd *obfd, asection *osec, void *ignored)
{
- bfd_size_type size, total_size = bfd_section_size (obfd, osec);
+ bfd_size_type size, total_size = bfd_section_size (osec);
file_ptr offset = 0;
/* Read-only sections are marked; we don't have to copy their contents. */
- if ((bfd_get_section_flags (obfd, osec) & SEC_LOAD) == 0)
+ if ((bfd_section_flags (osec) & SEC_LOAD) == 0)
return;
/* Only interested in "load" sections. */
- if (!startswith (bfd_section_name (obfd, osec), "load"))
+ if (!startswith (bfd_section_name (osec), "load"))
return;
size = std::min (total_size, (bfd_size_type) MAX_COPY_BYTES);
if (size > total_size)
size = total_size;
- if (target_read_memory (bfd_section_vma (obfd, osec) + offset,
+ if (target_read_memory (bfd_section_vma (osec) + offset,
memhunk.data (), size) != 0)
{
warning (_("Memory read failed for corefile "
"section, %s bytes at %s."),
plongest (size),
- paddress (target_gdbarch (), bfd_section_vma (obfd, osec)));
+ paddress (target_gdbarch (), bfd_section_vma (osec)));
break;
}
if (!bfd_set_section_contents (obfd, osec, memhunk.data (),
free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore)
{
struct gdb_bfd_section_data *sect
- = (struct gdb_bfd_section_data *) bfd_get_section_userdata (abfd, sectp);
+ = (struct gdb_bfd_section_data *) bfd_section_userdata (sectp);
if (sect != NULL && sect->data != NULL)
{
{
struct gdb_bfd_section_data *result;
- result = ((struct gdb_bfd_section_data *)
- bfd_get_section_userdata (section->owner, section));
+ result = (struct gdb_bfd_section_data *) bfd_section_userdata (section);
if (result == NULL)
{
result = ((struct gdb_bfd_section_data *)
bfd_zalloc (section->owner, sizeof (*result)));
- bfd_set_section_userdata (section->owner, section, result);
+ bfd_set_section_userdata (section, result);
}
return result;
/* Only try to mmap sections which are large enough: we don't want
to waste space due to fragmentation. */
- if (bfd_get_section_size (sectp) > 4 * pagesize)
+ if (bfd_section_size (sectp) > 4 * pagesize)
{
- descriptor->size = bfd_get_section_size (sectp);
+ descriptor->size = bfd_section_size (sectp);
descriptor->data = bfd_mmap (abfd, 0, descriptor->size, PROT_READ,
MAP_PRIVATE, sectp->filepos,
&descriptor->map_addr,
/* Handle compressed sections, or ordinary uncompressed sections in
the no-mmap case. */
- descriptor->size = bfd_get_section_size (sectp);
+ descriptor->size = bfd_section_size (sectp);
descriptor->data = NULL;
data = NULL;
if (!bfd_get_full_section_contents (abfd, sectp, &data))
{
warning (_("Can't read data for section '%s' in file '%s'"),
- bfd_get_section_name (abfd, sectp),
+ bfd_section_name (sectp),
bfd_get_filename (abfd));
/* Set size to 0 to prevent further attempts to read the invalid
section. */
/* Try to read or map the contents of the section SECT. If successful, the
section data is returned and *SIZE is set to the size of the section data;
- this may not be the same as the size according to bfd_get_section_size if the
+ this may not be the same as the size according to bfd_section_size if the
section was compressed. The returned section data is associated with the BFD
and will be destroyed when the BFD is destroyed. There is no other way to
free it; for temporary uses of section data, see bfd_malloc_and_get_section.
if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
|| strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
{
- unwind_size = bfd_section_size (objfile->obfd, unwind_sec);
+ unwind_size = bfd_section_size (unwind_sec);
unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
total_entries += unwind_entries;
if (stub_unwind_sec)
{
- stub_unwind_size = bfd_section_size (objfile->obfd, stub_unwind_sec);
+ stub_unwind_size = bfd_section_size (stub_unwind_sec);
stub_entries = stub_unwind_size / STUB_UNWIND_ENTRY_SIZE;
}
else
if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
|| strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
{
- unwind_size = bfd_section_size (objfile->obfd, unwind_sec);
+ unwind_size = bfd_section_size (unwind_sec);
unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
internalize_unwinds (objfile, &ui->table[index], unwind_sec,
if (!startswith (sect->name, ".module"))
return;
- buf = (gdb_byte *) xmalloc (bfd_get_section_size (sect) + 1);
+ buf = (gdb_byte *) xmalloc (bfd_section_size (sect) + 1);
if (!buf)
{
printf_unfiltered ("memory allocation failed for %s\n", sect->name);
goto out;
}
if (!bfd_get_section_contents (abfd, sect,
- buf, 0, bfd_get_section_size (sect)))
+ buf, 0, bfd_section_size (sect)))
goto out;
module_name_size =
extract_unsigned_integer (buf + 8, 4, byte_order);
- if (12 + module_name_size > bfd_get_section_size (sect))
+ if (12 + module_name_size > bfd_section_size (sect))
goto out;
module_name = (char *) buf + 12;
{
asection *section = bfd_get_section_by_name (abfd, ".reg");
if (section
- && bfd_section_size (abfd, section) == I386_WINDOWS_SIZEOF_GREGSET)
+ && bfd_section_size (section) == I386_WINDOWS_SIZEOF_GREGSET)
return GDB_OSABI_CYGWIN;
}
if (xstate)
{
- size_t size = bfd_section_size (abfd, xstate);
+ size_t size = bfd_section_size (xstate);
/* Check extended state size. */
if (size < X86_XSTATE_AVX_SIZE)
if (xstate)
{
- size_t size = bfd_section_size (abfd, xstate);
+ size_t size = bfd_section_size (xstate);
/* Check extended state size. */
if (size < X86_XSTATE_AVX_SIZE)
addresses that we care about. */
section_addr_info sai;
for (sec = nbfd->sections; sec != NULL; sec = sec->next)
- if ((bfd_get_section_flags (nbfd.get (), sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
+ if ((bfd_section_flags (sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
{
/* We assume that these virtual addresses are absolute, and do not
treat them as offsets. */
- sai.emplace_back (bfd_get_section_vma (nbfd.get (), sec),
- bfd_get_section_name (nbfd.get (), sec),
+ sai.emplace_back (bfd_section_vma (sec),
+ bfd_section_name (sec),
sec->index);
}
addr_size_bits = gdbarch_addr_bit (core_gdbarch);
addr_size = addr_size_bits / 8;
- note_size = bfd_get_section_size (section);
+ note_size = bfd_section_size (section);
if (note_size < 2 * addr_size)
error (_("malformed core note - too short for header"));
sec->name, sym->name,
paddress (arch, res));
}
- bfd_set_section_vma (abfd.get (), sec, res);
+ bfd_set_section_vma (sec, res);
sections_rebased[sec->index] = 1;
}
}
{
if (strcmp (asect->name, dsect->name) != 0)
break;
- bfd_set_section_size (dsym_bfd.get (), dsect,
- bfd_get_section_size (asect));
+ bfd_set_section_size (dsect, bfd_section_size (asect));
}
/* Add the dsym file as a separate file. */
asection *asect,
void *datum)
{
- flagword flags = bfd_get_section_flags (abfd, asect);
- const char *name = bfd_section_name (abfd, asect);
+ flagword flags = bfd_section_flags (asect);
+ const char *name = bfd_section_name (asect);
maint_print_section_data *print_data = (maint_print_section_data *) datum;
const char *arg = print_data->arg;
int addr_size = gdbarch_addr_bit (gdbarch) / 8;
CORE_ADDR addr, endaddr;
- addr = bfd_section_vma (abfd, asect);
- endaddr = addr + bfd_section_size (abfd, asect);
+ addr = bfd_section_vma (asect);
+ endaddr = addr + bfd_section_size (asect);
print_section_index (abfd, asect, print_data->index_digits);
maint_print_section_info (name, flags, addr, endaddr,
asect->filepos, addr_size);
struct obj_section *asect,
maint_print_section_data *print_data)
{
- flagword flags = bfd_get_section_flags (abfd, asect->the_bfd_section);
- const char *name = bfd_section_name (abfd, asect->the_bfd_section);
+ flagword flags = bfd_section_flags (asect->the_bfd_section);
+ const char *name = bfd_section_name (asect->the_bfd_section);
const char *string = print_data->arg;
if (string == NULL || *string == '\0'
the text section (and fh->adr) really starts at zero. */
text_sect = bfd_get_section_by_name (cur_bfd, ".text");
if (text_sect != NULL
- && (bfd_get_section_flags (cur_bfd, text_sect) & SEC_RELOC))
+ && (bfd_section_flags (text_sect) & SEC_RELOC))
relocatable = 1;
extern_tab = XOBNEWVEC (&objfile->objfile_obstack, EXTR, hdr->iextMax);
sec = find_pc_section (memaddr);
if (sec != NULL && sec->objfile != NULL)
{
- flagword flags = bfd_get_section_flags (sec->objfile->obfd,
- sec->the_bfd_section);
+ flagword flags = bfd_section_flags (sec->the_bfd_section);
if (flags & SEC_CODE)
mi_uiout->field_string ("type", "code");
struct gdb_lzma_stream *lstream;
size_t pos;
- size = bfd_get_section_size (section);
+ size = bfd_section_size (section);
offset = section->filepos + size - LZMA_STREAM_HEADER_SIZE;
if (size < LZMA_STREAM_HEADER_SIZE
|| bfd_seek (section->owner, offset, SEEK_SET) != 0
if (! section)
return NULL;
- switch (bfd_section_size (abfd, section))
+ switch (bfd_section_size (section))
{
case sizeof (mips_elf_gregset_t):
return mips_tdesc_gp32;
enum gdb_osabi *os_ident_ptr = (enum gdb_osabi *) obj;
const char *name;
- name = bfd_get_section_name (abfd, sect);
+ name = bfd_section_name (sect);
/* The presence of a section with a ".sde" prefix is indicative
of an SDE binary. */
mips_find_abi_section (bfd *abfd, asection *sect, void *obj)
{
enum mips_abi *abip = (enum mips_abi *) obj;
- const char *name = bfd_get_section_name (abfd, sect);
+ const char *name = bfd_section_name (sect);
if (*abip != MIPS_ABI_UNKNOWN)
return;
mips_find_long_section (bfd *abfd, asection *sect, void *obj)
{
int *lbp = (int *) obj;
- const char *name = bfd_get_section_name (abfd, sect);
+ const char *name = bfd_section_name (sect);
if (startswith (name, ".gcc_compiled_long32"))
*lbp = 32;
|| si.dyninfo_sect == NULL || si.got_sect == NULL)
return;
- gdb::byte_vector sym_sec (bfd_get_section_size (si.sym_sect));
- gdb::byte_vector str_sec (bfd_get_section_size (si.str_sect));
- gdb::byte_vector dyninfo_sec (bfd_get_section_size (si.dyninfo_sect));
- gdb::byte_vector got_sec (bfd_get_section_size (si.got_sect));
+ gdb::byte_vector sym_sec (bfd_section_size (si.sym_sect));
+ gdb::byte_vector str_sec (bfd_section_size (si.str_sect));
+ gdb::byte_vector dyninfo_sec (bfd_section_size (si.dyninfo_sect));
+ gdb::byte_vector got_sec (bfd_section_size (si.got_sect));
if (!bfd_get_section_contents (abfd, si.sym_sect, sym_sec.data (),
(file_ptr) 0, sym_sec.size ()))
const char *name;
const unsigned sizeof_Elf_Nhdr = 12;
- sectname = bfd_get_section_name (abfd, sect);
- sectsize = bfd_section_size (abfd, sect);
+ sectname = bfd_section_name (sect);
+ sectsize = bfd_section_size (sect);
if (sectsize > 128)
sectsize = 128;
{
flagword aflag;
- aflag = bfd_get_section_flags (abfd, asect);
+ aflag = bfd_section_flags (asect);
if (!(aflag & SEC_ALLOC))
return;
}
insert_section_p (const struct bfd *abfd,
const struct bfd_section *section)
{
- const bfd_vma lma = bfd_section_lma (abfd, section);
+ const bfd_vma lma = bfd_section_lma (section);
- if (overlay_debugging && lma != 0 && lma != bfd_section_vma (abfd, section)
+ if (overlay_debugging && lma != 0 && lma != bfd_section_vma (section)
&& (bfd_get_file_flags (abfd) & BFD_IN_MEMORY) == 0)
/* This is an overlay section. IN_MEMORY check is needed to avoid
discarding sections from the "system supplied DSO" (aka vdso)
on some Linux systems (e.g. Fedora 11). */
return 0;
- if ((bfd_get_section_flags (abfd, section) & SEC_THREAD_LOCAL) != 0)
+ if ((bfd_section_flags (section) & SEC_THREAD_LOCAL) != 0)
/* This is a TLS section. */
return 0;
" (A) section `%s' from `%s' [%s, %s)\n"
" (B) section `%s' from `%s' [%s, %s).\n"
"Will ignore section B"),
- bfd_section_name (abfd1, bfds1), objfile_name (objf1),
+ bfd_section_name (bfds1), objfile_name (objf1),
paddress (gdbarch, sect1_addr),
paddress (gdbarch, sect1_endaddr),
- bfd_section_name (abfd2, bfds2), objfile_name (objf2),
+ bfd_section_name (bfds2), objfile_name (objf2),
paddress (gdbarch, sect2_addr),
paddress (gdbarch, sect2_endaddr));
}
/* The memory address of section S (vma + offset). */
#define obj_section_addr(s) \
- (bfd_get_section_vma ((s)->objfile->obfd, s->the_bfd_section) \
+ (bfd_section_vma (s->the_bfd_section) \
+ obj_section_offset (s))
/* The one-passed-the-end memory address of section S
(vma + size + offset). */
#define obj_section_endaddr(s) \
- (bfd_get_section_vma ((s)->objfile->obfd, s->the_bfd_section) \
- + bfd_get_section_size ((s)->the_bfd_section) \
+ (bfd_section_vma (s->the_bfd_section) \
+ + bfd_section_size ((s)->the_bfd_section) \
+ obj_section_offset (s))
/* The "objstats" structure provides a place for gdb to record some
gdb_assert (notesz <= MAX_NOTESZ);
/* Check whether SECT is big enough to comtain the complete note. */
- if (notesz > bfd_section_size (abfd, sect))
+ if (notesz > bfd_section_size (sect))
return 0;
/* Check the note name. */
unsigned int sectsize;
char *note;
- name = bfd_get_section_name (abfd, sect);
- sectsize = bfd_section_size (abfd, sect);
+ name = bfd_section_name (sect);
+ sectsize = bfd_section_size (sect);
/* Limit the amount of data to read. */
if (sectsize > MAX_NOTESZ)
static int
ppc_linux_spu_section (bfd *abfd, asection *asect, void *user_data)
{
- return startswith (bfd_section_name (abfd, asect), "SPU/");
+ return startswith (bfd_section_name (asect), "SPU/");
}
static const struct target_desc *
if (! section)
return NULL;
- switch (bfd_section_size (abfd, section))
+ switch (bfd_section_size (section))
{
case 48 * 4:
features.wordsize = 4;
s->the_bfd_section,
&buf, addr - s->addr, 8);
if (res != 0)
- return extract_unsigned_integer (buf, 8, byte_order)
- - bfd_section_vma (s->bfd, s->the_bfd_section) + s->addr;
+ return (extract_unsigned_integer (buf, 8, byte_order)
+ - bfd_section_vma (s->the_bfd_section) + s->addr);
}
return addr;
if (section != NULL)
{
/* Check if the section we found is readonly. */
- if ((bfd_get_section_flags (section->the_bfd_section->owner,
- section->the_bfd_section)
+ if ((bfd_section_flags (section->the_bfd_section)
& SEC_READONLY) != 0)
{
/* Truncate the request to fit into this section. */
osec ? "succeeded" : "failed");
if (osec == NULL)
return;
- osec_size = bfd_section_size (core_bfd, osec);
+ osec_size = bfd_section_size (osec);
if (record_debug)
- fprintf_unfiltered (gdb_stdlog, "%s", bfd_section_name (core_bfd, osec));
+ fprintf_unfiltered (gdb_stdlog, "%s", bfd_section_name (osec));
/* Check the magic code. */
bfdcore_read (core_bfd, osec, &magic, sizeof (magic), &bfd_offset);
error (_("Failed to create 'precord' section for corefile %s: %s"),
recfilename,
bfd_errmsg (bfd_get_error ()));
- bfd_set_section_size (obfd.get (), osec, save_size);
- bfd_set_section_vma (obfd.get (), osec, 0);
- bfd_set_section_alignment (obfd.get (), osec, 0);
- bfd_section_lma (obfd.get (), osec) = 0;
+ bfd_set_section_size (osec, save_size);
+ bfd_set_section_vma (osec, 0);
+ bfd_set_section_alignment (osec, 0);
/* Save corefile state. */
write_gcore_file (obfd.get ());
secp = target_section_by_addr (this, memaddr);
if (secp != NULL
- && (bfd_get_section_flags (secp->the_bfd_section->owner,
- secp->the_bfd_section)
- & SEC_READONLY))
+ && (bfd_section_flags (secp->the_bfd_section) & SEC_READONLY))
{
struct target_section *p;
ULONGEST memend = memaddr + len;
if (read_only && (s->flags & SEC_READONLY) == 0)
continue; /* Skip writeable sections */
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
if (size == 0)
continue; /* Skip zero-length section. */
- sectname = bfd_get_section_name (exec_bfd, s);
+ sectname = bfd_section_name (s);
if (args && strcmp (args, sectname) != 0)
continue; /* Not the section selected by user. */
remote_target::trace_set_readonly_regions ()
{
asection *s;
- bfd *abfd = NULL;
bfd_size_type size;
bfd_vma vma;
int anysecs = 0;
continue;
anysecs = 1;
- vma = bfd_get_section_vma (abfd, s);
- size = bfd_get_section_size (s);
+ vma = bfd_section_vma (s);
+ size = bfd_section_size (s);
sprintf_vma (tmp1, vma);
sprintf_vma (tmp2, vma + size);
sec_length = 1 + strlen (tmp1) + 1 + strlen (tmp2);
if (ldinfo_sec == NULL)
error (_("cannot find .ldinfo section from core file: %s"),
bfd_errmsg (bfd_get_error ()));
- ldinfo_size = bfd_get_section_size (ldinfo_sec);
+ ldinfo_size = bfd_section_size (ldinfo_sec);
gdb::byte_vector ldinfo_buf (ldinfo_size);
if (!sect)
return 0;
- size = bfd_get_section_size (sect);
+ size = bfd_section_size (sect);
contents = (gdb_byte *) xmalloc (size);
if (!bfd_get_section_contents (abfd, sect, contents, 0, size))
{
te = (hwcap & HWCAP_S390_TE);
gs = (hwcap & HWCAP_S390_GS);
- switch (bfd_section_size (abfd, section))
+ switch (bfd_section_size (section))
{
case s390_sizeof_gregset:
if (high_gprs)
struct target_section *secp;
secp = target_section_by_addr (current_top_target (), addr.k);
if (secp != NULL
- && (bfd_get_section_flags (secp->the_bfd_section->owner,
- secp->the_bfd_section)
- & SEC_READONLY))
+ && (bfd_section_flags (secp->the_bfd_section) & SEC_READONLY))
return pv_constant (read_memory_integer (addr.k, size,
data->byte_order));
}
section after the .data section (the problem has only been
observed when using the GNU linker, and the default linker
script always places the .data and .bss sections in that order). */
- if (bfd_section_vma (abfd, bss_sect)
- < bfd_section_vma (abfd, data_sect))
+ if (bfd_section_vma (bss_sect) < bfd_section_vma (data_sect))
return 0;
- if (bfd_section_vma (abfd, bss_sect)
- < bfd_section_vma (abfd, data_sect) + bfd_get_section_size (data_sect))
- return ((bfd_section_vma (abfd, data_sect)
- + bfd_get_section_size (data_sect))
- - bfd_section_vma (abfd, bss_sect));
+ if (bfd_section_vma (bss_sect)
+ < bfd_section_vma (data_sect) + bfd_section_size (data_sect))
+ return (bfd_section_vma (data_sect) + bfd_section_size (data_sect)
+ - bfd_section_vma (bss_sect));
return 0;
}
{
struct bfd_section *bfd_sect = sec->the_bfd_section;
bfd *abfd = bfd_sect->owner;
- const char *section_name = bfd_section_name (abfd, bfd_sect);
+ const char *section_name = bfd_section_name (bfd_sect);
lm_info_aix *info = (lm_info_aix *) so->lm_info;
if (strcmp (section_name, ".text") == 0)
CORE_ADDR data_offset = 0;
if (data_sect != NULL)
- data_offset = info->data_addr - bfd_section_vma (abfd, data_sect);
+ data_offset = info->data_addr - bfd_section_vma (data_sect);
- sec->addr = bfd_section_vma (abfd, bfd_sect) + data_offset;
+ sec->addr = bfd_section_vma (bfd_sect) + data_offset;
sec->addr += solib_aix_bss_data_overlap (abfd);
- sec->endaddr = sec->addr + bfd_section_size (abfd, bfd_sect);
+ sec->endaddr = sec->addr + bfd_section_size (bfd_sect);
}
else
{
/* All other sections should not be relocated. */
- sec->addr = bfd_section_vma (abfd, bfd_sect);
- sec->endaddr = sec->addr + bfd_section_size (abfd, bfd_sect);
+ sec->addr = bfd_section_vma (bfd_sect);
+ sec->endaddr = sec->addr + bfd_section_size (bfd_sect);
}
}
= objfile->sections[objfile->sect_index_text].the_bfd_section;
offsets->offsets[objfile->sect_index_text]
- = info->text_addr + sect->filepos - bfd_section_vma (abfd, sect);
+ = info->text_addr + sect->filepos - bfd_section_vma (sect);
}
/* .data */
= objfile->sections[objfile->sect_index_data].the_bfd_section;
offsets->offsets[objfile->sect_index_data]
- = info->data_addr - bfd_section_vma (abfd, sect);
+ = info->data_addr - bfd_section_vma (sect);
}
/* .bss
struct obj_section *osect;
ALL_OBJFILE_OSECTIONS (objfile, osect)
- if (strcmp (bfd_section_name (objfile->obfd, osect->the_bfd_section),
- ".data") == 0)
+ if (strcmp (bfd_section_name (osect->the_bfd_section), ".data") == 0)
return osect;
return NULL;
such fallback to the file VMA address without the possibility of
having the section relocated to its actual in-memory address. */
- dyn_addr = bfd_section_vma (abfd, sect);
+ dyn_addr = bfd_section_vma (sect);
}
/* Read in .dynamic from the BFD. We will get the actual value
from memory later. */
- sect_size = bfd_section_size (abfd, sect);
+ sect_size = bfd_section_size (sect);
buf = bufstart = (gdb_byte *) alloca (sect_size);
if (!bfd_get_section_contents (abfd, sect,
buf, 0, sect_size))
/* Read the contents of the .interp section into a local buffer;
the contents specify the dynamic linker this program uses. */
- interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
+ interp_sect_size = bfd_section_size (interp_sect);
buf = (char *) alloca (interp_sect_size);
bfd_get_section_contents (exec_bfd, interp_sect,
buf, 0, interp_sect_size);
interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".text");
if (interp_sect)
{
- info->interp_text_sect_low
- = bfd_section_vma (tmp_bfd.get (), interp_sect);
+ info->interp_text_sect_low = bfd_section_vma (interp_sect);
info->interp_text_sect_low
+= displacement_from_map (ldm, info->interp_text_sect_low);
info->interp_text_sect_high
- = info->interp_text_sect_low
- + bfd_section_size (tmp_bfd.get (), interp_sect);
+ = info->interp_text_sect_low + bfd_section_size (interp_sect);
}
interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".plt");
if (interp_sect)
{
- info->interp_plt_sect_low =
- bfd_section_vma (tmp_bfd.get (), interp_sect);
+ info->interp_plt_sect_low = bfd_section_vma (interp_sect);
info->interp_plt_sect_low
+= displacement_from_map (ldm, info->interp_plt_sect_low);
- info->interp_plt_sect_high =
- info->interp_plt_sect_low + bfd_section_size (tmp_bfd.get (),
- interp_sect);
+ info->interp_plt_sect_high
+ = info->interp_plt_sect_low + bfd_section_size (interp_sect);
}
addr = gdb_bfd_lookup_symbol (tmp_bfd.get (), cmp_name,
/* Read the contents of the .interp section into a local buffer;
the contents specify the dynamic linker this program uses. */
- interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
+ interp_sect_size = bfd_section_size (interp_sect);
buf = (char *) alloca (interp_sect_size);
bfd_get_section_contents (exec_bfd, interp_sect,
buf, 0, interp_sect_size);
interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".text");
if (interp_sect)
{
- interp_text_sect_low
- = bfd_section_vma (tmp_bfd.get (), interp_sect);
+ interp_text_sect_low = bfd_section_vma (interp_sect);
interp_text_sect_low
+= displacement_from_map (ldm, interp_text_sect_low);
interp_text_sect_high
- = interp_text_sect_low + bfd_section_size (tmp_bfd.get (),
- interp_sect);
+ = interp_text_sect_low + bfd_section_size (interp_sect);
}
interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".plt");
if (interp_sect)
{
- interp_plt_sect_low =
- bfd_section_vma (tmp_bfd.get (), interp_sect);
+ interp_plt_sect_low = bfd_section_vma (interp_sect);
interp_plt_sect_low
+= displacement_from_map (ldm, interp_plt_sect_low);
interp_plt_sect_high =
- interp_plt_sect_low + bfd_section_size (tmp_bfd.get (),
- interp_sect);
+ interp_plt_sect_low + bfd_section_size (interp_sect);
}
addr = gdb_bfd_lookup_symbol (tmp_bfd.get (), cmp_name, "_dl_debug_addr");
spu_name = bfd_get_section_by_name (abfd.get (), ".note.spu_name");
if (spu_name)
{
- int sect_size = bfd_section_size (abfd.get (), spu_name);
+ int sect_size = bfd_section_size (spu_name);
if (sect_size > 20)
{
if (dyninfo_sect == NULL)
goto set_addr;
- dynaddr = bfd_section_vma (abfd, dyninfo_sect);
+ dynaddr = bfd_section_vma (dyninfo_sect);
if (dynaddr + l_addr != l_dynaddr)
{
interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
if (interp_sect != NULL)
{
- int sect_size = bfd_section_size (exec_bfd, interp_sect);
+ int sect_size = bfd_section_size (interp_sect);
gdb::byte_vector buf (sect_size);
bfd_get_section_contents (exec_bfd, interp_sect, buf.data (), 0,
such fallback to the file VMA address without the possibility of
having the section relocated to its actual in-memory address. */
- dyn_addr = bfd_section_vma (abfd, sect);
+ dyn_addr = bfd_section_vma (sect);
}
/* Read in .dynamic from the BFD. We will get the actual value
from memory later. */
- sect_size = bfd_section_size (abfd, sect);
+ sect_size = bfd_section_size (sect);
buf = bufstart = (gdb_byte *) alloca (sect_size);
if (!bfd_get_section_contents (abfd, sect,
buf, 0, sect_size))
interp_sect = bfd_get_section_by_name (tmp_bfd, ".text");
if (interp_sect)
{
- info->interp_text_sect_low =
- bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
- info->interp_text_sect_high =
- info->interp_text_sect_low
- + bfd_section_size (tmp_bfd, interp_sect);
+ info->interp_text_sect_low
+ = bfd_section_vma (interp_sect) + load_addr;
+ info->interp_text_sect_high
+ = info->interp_text_sect_low + bfd_section_size (interp_sect);
}
interp_sect = bfd_get_section_by_name (tmp_bfd, ".plt");
if (interp_sect)
{
- info->interp_plt_sect_low =
- bfd_section_vma (tmp_bfd, interp_sect) + load_addr;
- info->interp_plt_sect_high =
- info->interp_plt_sect_low
- + bfd_section_size (tmp_bfd, interp_sect);
+ info->interp_plt_sect_low
+ = bfd_section_vma (interp_sect) + load_addr;
+ info->interp_plt_sect_high
+ = info->interp_plt_sect_low + bfd_section_size (interp_sect);
}
svr4_create_solib_event_breakpoints (info, target_gdbarch (), sym_addr);
interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".text");
if (interp_sect)
{
- info->interp_text_sect_low =
- bfd_section_vma (tmp_bfd.get (), interp_sect) + load_addr;
- info->interp_text_sect_high =
- info->interp_text_sect_low
- + bfd_section_size (tmp_bfd.get (), interp_sect);
+ info->interp_text_sect_low
+ = bfd_section_vma (interp_sect) + load_addr;
+ info->interp_text_sect_high
+ = info->interp_text_sect_low + bfd_section_size (interp_sect);
}
interp_sect = bfd_get_section_by_name (tmp_bfd.get (), ".plt");
if (interp_sect)
{
- info->interp_plt_sect_low =
- bfd_section_vma (tmp_bfd.get (), interp_sect) + load_addr;
- info->interp_plt_sect_high =
- info->interp_plt_sect_low
- + bfd_section_size (tmp_bfd.get (), interp_sect);
+ info->interp_plt_sect_low
+ = bfd_section_vma (interp_sect) + load_addr;
+ info->interp_plt_sect_high
+ = info->interp_plt_sect_low + bfd_section_size (interp_sect);
}
/* Now try to set a breakpoint in the dynamic linker. */
gdb_byte *buf_filesz_p = (gdb_byte *) &phdrp->p_filesz;
CORE_ADDR filesz;
- content2 = (bfd_get_section_flags (exec_bfd, plt2_asect)
+ content2 = (bfd_section_flags (plt2_asect)
& SEC_HAS_CONTENTS) != 0;
filesz = extract_unsigned_integer (buf_filesz_p, 4,
/* PLT2_ASECT is from on-disk file (exec_bfd) while
FILESZ is from the in-memory image. */
if (content2)
- filesz += bfd_get_section_size (plt2_asect);
+ filesz += bfd_section_size (plt2_asect);
else
- filesz -= bfd_get_section_size (plt2_asect);
+ filesz -= bfd_section_size (plt2_asect);
store_unsigned_integer (buf_filesz_p, 4, byte_order,
filesz);
gdb_byte *buf_filesz_p = (gdb_byte *) &phdrp->p_filesz;
CORE_ADDR filesz;
- content2 = (bfd_get_section_flags (exec_bfd, plt2_asect)
+ content2 = (bfd_section_flags (plt2_asect)
& SEC_HAS_CONTENTS) != 0;
filesz = extract_unsigned_integer (buf_filesz_p, 8,
/* PLT2_ASECT is from on-disk file (exec_bfd) while
FILESZ is from the in-memory image. */
if (content2)
- filesz += bfd_get_section_size (plt2_asect);
+ filesz += bfd_section_size (plt2_asect);
else
- filesz -= bfd_get_section_size (plt2_asect);
+ filesz -= bfd_section_size (plt2_asect);
store_unsigned_integer (buf_filesz_p, 8, byte_order,
filesz);
for (asect = exec_bfd->sections; asect != NULL; asect = asect->next)
exec_set_section_address (bfd_get_filename (exec_bfd), asect->index,
- (bfd_section_vma (exec_bfd, asect)
- + displacement));
+ bfd_section_vma (asect) + displacement);
}
}
for (i = 0, sect = so->abfd->sections;
sect != NULL;
i++, sect = sect->next)
- if ((bfd_get_section_flags (so->abfd, sect) & SEC_ALLOC))
+ if ((bfd_section_flags (sect) & SEC_ALLOC))
num_alloc_sections++;
if (num_alloc_sections != li->section_bases.size ())
sect != NULL;
i++, sect = sect->next)
{
- if (!(bfd_get_section_flags (so->abfd, sect) & SEC_ALLOC))
+ if (!(bfd_section_flags (sect) & SEC_ALLOC))
continue;
- if (bfd_section_size (so->abfd, sect) > 0)
+ if (bfd_section_size (sect) > 0)
{
CORE_ADDR low, high;
low = li->section_bases[i];
- high = low + bfd_section_size (so->abfd, sect) - 1;
+ high = low + bfd_section_size (sect) - 1;
if (low < so->addr_low)
so->addr_low = low;
spu_name = bfd_get_section_by_name (nbfd.get (), ".note.spu_name");
if (spu_name)
{
- int sect_size = bfd_section_size (nbfd.get (), spu_name);
+ int sect_size = bfd_section_size (spu_name);
if (sect_size > 20)
{
char *buf = (char *)alloca (sect_size - 20 + 1);
continue;
ALL_OBJFILE_OSECTIONS (objfile, osect)
- if (vma == bfd_section_vma (objfile->obfd, osect->the_bfd_section)
+ if (vma == bfd_section_vma (osect->the_bfd_section)
&& pos == osect->the_bfd_section->filepos)
{
int ndx = osect - objfile->sections;
int ndx = osect - objfile->sections;
if (ovly_table[ndx].mapped_ptr == 0)
- bfd_section_lma (obfd, bsect) = bfd_section_vma (obfd, bsect);
+ bfd_set_section_lma (bsect, bfd_section_vma (bsect));
else
- bfd_section_lma (obfd, bsect) = SPU_OVERLAY_LMA + bsect->filepos;
+ bfd_set_section_lma (bsect, SPU_OVERLAY_LMA + bsect->filepos);
}
}
section_addr_info sai;
for (sec = nbfd->sections; sec != NULL; sec = sec->next)
- if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
- sai.emplace_back (bfd_get_section_vma (nbfd, sec) + loadbase,
- bfd_get_section_name (nbfd, sec),
+ if ((bfd_section_flags (sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
+ sai.emplace_back (bfd_section_vma (sec) + loadbase,
+ bfd_section_name (sec),
sec->index);
if (from_tty)
{
asection **lowest = (asection **) obj;
- if (0 == (bfd_get_section_flags (abfd, sect) & (SEC_ALLOC | SEC_LOAD)))
+ if (0 == (bfd_section_flags (sect) & (SEC_ALLOC | SEC_LOAD)))
return;
if (!*lowest)
*lowest = sect; /* First loadable section */
- else if (bfd_section_vma (abfd, *lowest) > bfd_section_vma (abfd, sect))
+ else if (bfd_section_vma (*lowest) > bfd_section_vma (sect))
*lowest = sect; /* A lower loadable section */
- else if (bfd_section_vma (abfd, *lowest) == bfd_section_vma (abfd, sect)
- && (bfd_section_size (abfd, (*lowest))
- <= bfd_section_size (abfd, sect)))
+ else if (bfd_section_vma (*lowest) == bfd_section_vma (sect)
+ && (bfd_section_size (*lowest) <= bfd_section_size (sect)))
*lowest = sect;
}
struct bfd_section *asect = stp->the_bfd_section;
bfd *abfd = asect->owner;
- if (bfd_get_section_flags (abfd, asect) & (SEC_ALLOC | SEC_LOAD)
+ if (bfd_section_flags (asect) & (SEC_ALLOC | SEC_LOAD)
&& sap.size () < end - start)
sap.emplace_back (stp->addr,
- bfd_section_name (abfd, asect),
+ bfd_section_name (asect),
gdb_bfd_section_index (abfd, asect));
}
section_addr_info sap;
for (sec = abfd->sections; sec != NULL; sec = sec->next)
- if (bfd_get_section_flags (abfd, sec) & (SEC_ALLOC | SEC_LOAD))
- sap.emplace_back (bfd_get_section_vma (abfd, sec),
- bfd_get_section_name (abfd, sec),
+ if (bfd_section_flags (sec) & (SEC_ALLOC | SEC_LOAD))
+ sap.emplace_back (bfd_section_vma (sec),
+ bfd_section_name (sec),
gdb_bfd_section_index (abfd, sec));
return sap;
struct place_section_arg *arg = (struct place_section_arg *) obj;
CORE_ADDR *offsets = arg->offsets->offsets, start_addr;
int done;
- ULONGEST align = ((ULONGEST) 1) << bfd_get_section_alignment (abfd, sect);
+ ULONGEST align = ((ULONGEST) 1) << bfd_section_alignment (sect);
/* We are only interested in allocated sections. */
- if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
return;
/* If the user specified an offset, honor it. */
continue;
/* We can only conflict with allocated sections. */
- if ((bfd_get_section_flags (abfd, cur_sec) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
continue;
/* If the section offset is 0, either the section has not been placed
continue;
/* If this section would overlap us, then we must move up. */
- if (start_addr + bfd_get_section_size (sect) > offsets[indx]
- && start_addr < offsets[indx] + bfd_get_section_size (cur_sec))
+ if (start_addr + bfd_section_size (sect) > offsets[indx]
+ && start_addr < offsets[indx] + bfd_section_size (cur_sec))
{
- start_addr = offsets[indx] + bfd_get_section_size (cur_sec);
+ start_addr = offsets[indx] + bfd_section_size (cur_sec);
start_addr = (start_addr + align - 1) & -align;
done = 0;
break;
while (!done);
offsets[gdb_bfd_section_index (abfd, sect)] = start_addr;
- arg->lowest = start_addr + bfd_get_section_size (sect);
+ arg->lowest = start_addr + bfd_section_size (sect);
}
/* Store section_addr_info as prepared (made relative and with SECTINDEX
lower_offset = 0;
}
else
- lower_offset = bfd_section_vma (bfd_get_filename (abfd), lower_sect);
+ lower_offset = bfd_section_vma (lower_sect);
/* Create ADDRS_TO_ABFD_ADDRS array to map the sections in ADDRS to sections
in ABFD. Section names are not unique - there can be multiple sections of
for (cur_sec = abfd->sections; cur_sec != NULL; cur_sec = cur_sec->next)
/* We do not expect this to happen; just skip this step if the
relocatable file has a section with an assigned VMA. */
- if (bfd_section_vma (abfd, cur_sec) != 0)
+ if (bfd_section_vma (cur_sec) != 0)
break;
if (cur_sec == NULL)
for (cur_sec = abfd->sections; cur_sec != NULL;
cur_sec = cur_sec->next)
{
- if ((bfd_get_section_flags (abfd, cur_sec) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (cur_sec) & SEC_ALLOC) == 0)
continue;
- bfd_set_section_vma (abfd, cur_sec, offsets[cur_sec->index]);
+ bfd_set_section_vma (cur_sec, offsets[cur_sec->index]);
exec_set_section_address (bfd_get_filename (abfd),
cur_sec->index,
offsets[cur_sec->index]);
/* Make sure there is at least one loadable section in the file. */
for (sect = abfd->sections; sect != NULL; sect = sect->next)
{
- if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
continue;
break;
if (sect == NULL)
return NULL;
- low = bfd_get_section_vma (abfd, sect);
- high = low + bfd_get_section_size (sect);
+ low = bfd_section_vma (sect);
+ high = low + bfd_section_size (sect);
data = XCNEW (struct symfile_segment_data);
data->num_segments = 1;
{
CORE_ADDR vma;
- if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0)
+ if ((bfd_section_flags (sect) & SEC_ALLOC) == 0)
continue;
- vma = bfd_get_section_vma (abfd, sect);
+ vma = bfd_section_vma (sect);
if (vma < low)
low = vma;
- if (vma + bfd_get_section_size (sect) > high)
- high = vma + bfd_get_section_size (sect);
+ if (vma + bfd_section_size (sect) > high)
+ high = vma + bfd_section_size (sect);
data->segment_info[i] = 1;
}
{
struct bfd_section *sect = osect->the_bfd_section;
- if (entry_point >= bfd_get_section_vma (objfile->obfd, sect)
- && entry_point < (bfd_get_section_vma (objfile->obfd, sect)
- + bfd_get_section_size (sect)))
+ if (entry_point >= bfd_section_vma (sect)
+ && entry_point < (bfd_section_vma (sect)
+ + bfd_section_size (sect)))
{
ei->the_bfd_section_index
= gdb_bfd_section_index (objfile->obfd, sect);
{
bfd_size_type *sum = (bfd_size_type *) data;
- *sum += bfd_get_section_size (asec);
+ *sum += bfd_section_size (asec);
}
/* Opaque data for load_progress. */
load_section_callback (bfd *abfd, asection *asec, void *data)
{
struct load_section_data *args = (struct load_section_data *) data;
- bfd_size_type size = bfd_get_section_size (asec);
- const char *sect_name = bfd_get_section_name (abfd, asec);
+ bfd_size_type size = bfd_section_size (asec);
+ const char *sect_name = bfd_section_name (asec);
- if ((bfd_get_section_flags (abfd, asec) & SEC_LOAD) == 0)
+ if ((bfd_section_flags (asec) & SEC_LOAD) == 0)
return;
if (size == 0)
return;
- ULONGEST begin = bfd_section_lma (abfd, asec) + args->load_offset;
+ ULONGEST begin = bfd_section_lma (asec) + args->load_offset;
ULONGEST end = begin + size;
gdb_byte *buffer = (gdb_byte *) xmalloc (size);
bfd_get_section_contents (abfd, asec, buffer, 0, size);
{
asection *bfd_section = section->the_bfd_section;
- if (bfd_section_lma (abfd, bfd_section) != 0
- && bfd_section_lma (abfd, bfd_section)
- != bfd_section_vma (abfd, bfd_section))
+ if (bfd_section_lma (bfd_section) != 0
+ && bfd_section_lma (bfd_section) != bfd_section_vma (bfd_section))
return 1;
}
{
if (section_is_overlay (section))
{
- bfd *abfd = section->objfile->obfd;
asection *bfd_section = section->the_bfd_section;
/* We assume the LMA is relocated by the same offset as the VMA. */
- bfd_vma size = bfd_get_section_size (bfd_section);
+ bfd_vma size = bfd_section_size (bfd_section);
CORE_ADDR offset = obj_section_offset (section);
- if (bfd_get_section_lma (abfd, bfd_section) + offset <= pc
- && pc < bfd_get_section_lma (abfd, bfd_section) + offset + size)
+ if (bfd_section_lma (bfd_section) + offset <= pc
+ && pc < bfd_section_lma (bfd_section) + offset + size)
return 1;
}
{
asection *bfd_section = section->the_bfd_section;
- return pc + bfd_section_lma (abfd, bfd_section)
- - bfd_section_vma (abfd, bfd_section);
+ return (pc + bfd_section_lma (bfd_section)
+ - bfd_section_vma (bfd_section));
}
return pc;
{
asection *bfd_section = section->the_bfd_section;
- return pc + bfd_section_vma (abfd, bfd_section)
- - bfd_section_lma (abfd, bfd_section);
+ return (pc + bfd_section_vma (bfd_section)
+ - bfd_section_lma (bfd_section));
}
return pc;
bfd_vma lma, vma;
int size;
- vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
- lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
- size = bfd_get_section_size (osect->the_bfd_section);
- name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
+ vma = bfd_section_vma (osect->the_bfd_section);
+ lma = bfd_section_lma (osect->the_bfd_section);
+ size = bfd_section_size (osect->the_bfd_section);
+ name = bfd_section_name (osect->the_bfd_section);
printf_filtered ("Section %s, loaded at ", name);
fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
/* First, find a section matching the user supplied argument. */
for (objfile *obj_file : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (obj_file, sec)
- if (!strcmp (bfd_section_name (obj_file->obfd, sec->the_bfd_section),
- args))
+ if (!strcmp (bfd_section_name (sec->the_bfd_section), args))
{
/* Now, check to see if the section is an overlay. */
if (!section_is_overlay (sec))
{
if (info_verbose)
printf_unfiltered (_("Note: section %s unmapped by overlap\n"),
- bfd_section_name (obj_file->obfd,
- sec2->the_bfd_section));
+ bfd_section_name (sec2->the_bfd_section));
sec2->ovly_mapped = 0; /* sec2 overlaps sec: unmap sec2. */
}
return;
/* First, find a section matching the user supplied argument. */
for (objfile *objfile : current_program_space->objfiles ())
ALL_OBJFILE_OSECTIONS (objfile, sec)
- if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
+ if (!strcmp (bfd_section_name (sec->the_bfd_section), args))
{
if (!sec->ovly_mapped)
error (_("Section %s is not mapped"), args);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
for (i = 0; i < cache_novlys; i++)
- if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
- && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect))
+ if (cache_ovly_table[i][VMA] == bfd_section_vma (bsect)
+ && cache_ovly_table[i][LMA] == bfd_section_lma (bsect))
{
read_target_long_array (cache_ovly_table_base + i * word_size,
(unsigned int *) cache_ovly_table[i],
4, word_size, byte_order);
- if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
- && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect))
+ if (cache_ovly_table[i][VMA] == bfd_section_vma (bsect)
+ && cache_ovly_table[i][LMA] == bfd_section_lma (bsect))
{
osect->ovly_mapped = cache_ovly_table[i][MAPPED];
return 1;
asection *bsect = osect->the_bfd_section;
for (i = 0; i < cache_novlys; i++)
- if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
- && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect))
+ if (cache_ovly_table[i][VMA] == bfd_section_vma (bsect)
+ && cache_ovly_table[i][LMA] == bfd_section_lma (bsect))
{ /* obj_section matches i'th entry in ovly_table. */
osect->ovly_mapped = cache_ovly_table[i][MAPPED];
break; /* finished with inner for loop: break out. */
{
if (section->the_bfd_section != NULL)
fprintf_filtered (outfile, " section %s",
- bfd_section_name (objfile->obfd,
- section->the_bfd_section));
+ bfd_section_name (section->the_bfd_section));
else
fprintf_filtered (outfile, " spurious section %ld",
(long) (section - objfile->sections));
outfile);
if (section)
fprintf_filtered (outfile, " section %s\n",
- bfd_section_name (section->the_bfd_section->owner,
- section->the_bfd_section));
+ bfd_section_name (section->the_bfd_section));
else
fprintf_filtered (outfile, "\n");
return;
outfile);
if (section)
fprintf_filtered (outfile, " section %s",
- bfd_section_name (section->the_bfd_section->owner,
- section->the_bfd_section));
+ bfd_section_name (section->the_bfd_section));
break;
case LOC_REGISTER:
outfile);
if (section)
fprintf_filtered (outfile, " section %s",
- bfd_section_name (section->the_bfd_section->owner,
- section->the_bfd_section));
+ bfd_section_name (section->the_bfd_section));
break;
case LOC_BLOCK:
outfile);
if (section)
fprintf_filtered (outfile, " section %s",
- bfd_section_name (section->the_bfd_section->owner,
- section->the_bfd_section));
+ bfd_section_name (section->the_bfd_section));
break;
case LOC_COMPUTED:
have the same size, address, and name. We can't compare section indexes,
which would be more reliable, because some sections may have been
stripped. */
- if (bfd_get_section_size (first) != bfd_get_section_size (second))
+ if (bfd_section_size (first) != bfd_section_size (second))
return 0;
/* In-memory addresses may start at a different offset, relativize them. */
- if (bfd_get_section_vma (first->owner, first)
- - bfd_get_start_address (first->owner)
- != bfd_get_section_vma (second->owner, second)
- - bfd_get_start_address (second->owner))
+ if (bfd_section_vma (first) - bfd_get_start_address (first->owner)
+ != bfd_section_vma (second) - bfd_get_start_address (second->owner))
return 0;
- if (bfd_get_section_name (first->owner, first) == NULL
- || bfd_get_section_name (second->owner, second) == NULL
- || strcmp (bfd_get_section_name (first->owner, first),
- bfd_get_section_name (second->owner, second)) != 0)
+ if (bfd_section_name (first) == NULL
+ || bfd_section_name (second) == NULL
+ || strcmp (bfd_section_name (first), bfd_section_name (second)) != 0)
return 0;
/* Otherwise check that they are in corresponding objfiles. */
secp = target_section_by_addr (ops, memaddr);
if (secp != NULL
- && (bfd_get_section_flags (secp->the_bfd_section->owner,
- secp->the_bfd_section)
- & SEC_READONLY))
+ && (bfd_section_flags (secp->the_bfd_section) & SEC_READONLY))
{
table = target_get_section_table (ops);
return section_table_xfer_memory_partial (readbuf, writebuf,
file header and the section alignment. */
cygwin_load_start = (CORE_ADDR) (uintptr_t) ((char *)
load_addr + 0x1000);
- cygwin_load_end = cygwin_load_start + bfd_section_size (abfd.get (),
- text);
+ cygwin_load_end = cygwin_load_start + bfd_section_size (text);
}
#endif
if (sect->target_index == args->targ_index)
{
/* This is the section. Figure out what SECT_OFF_* code it is. */
- if (bfd_get_section_flags (abfd, sect) & SEC_CODE)
+ if (bfd_section_flags (sect) & SEC_CODE)
*args->resultp = SECT_OFF_TEXT (objfile);
- else if (bfd_get_section_flags (abfd, sect) & SEC_LOAD)
+ else if (bfd_section_flags (sect) & SEC_LOAD)
*args->resultp = SECT_OFF_DATA (objfile);
else
*args->resultp = gdb_bfd_section_index (abfd, sect);
section. */
bfd_sect = secnum_to_bfd_section (symbol.n_scnum, objfile);
if (bfd_sect)
- toc_offset -= bfd_section_vma (objfile->obfd, bfd_sect);
+ toc_offset -= bfd_section_vma (bfd_sect);
break;
case XMC_TC:
secp = bfd_get_section_by_name (abfd, ".debug");
if (secp)
{
- length = bfd_section_size (abfd, secp);
+ length = bfd_section_size (secp);
if (length)
{
debugsec
if (objfile->num_sections == 0)
return; /* Is that even possible? Better safe than sorry. */
- first_section_name
- = bfd_section_name (objfile->obfd, objfile->sections[0].the_bfd_section);
+ first_section_name = bfd_section_name (objfile->sections[0].the_bfd_section);
if (objfile->sect_index_text == 0
&& strcmp (first_section_name, ".text") != 0)
if (sect == NULL)
return -1; /* Not a core file. */
- for (offset = 0; offset < bfd_get_section_size (sect);)
+ for (offset = 0; offset < bfd_section_size (sect);)
{
int next;
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * corefile.c, * symtab.c: Update throughout for bfd section
+ macro and function changes.
+
2019-09-18 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Re-generate.
void
core_get_text_space (bfd *cbfd)
{
- core_text_space = malloc (bfd_get_section_size (core_text_sect));
+ core_text_space = malloc (bfd_section_size (core_text_sect));
if (!core_text_space)
{
fprintf (stderr, _("%s: ran out room for %lu bytes of text space\n"),
- whoami, (unsigned long) bfd_get_section_size (core_text_sect));
+ whoami, (unsigned long) bfd_section_size (core_text_sect));
done (1);
}
if (!bfd_get_section_contents (cbfd, core_text_sect, core_text_space,
- 0, bfd_get_section_size (core_text_sect)))
+ 0, bfd_section_size (core_text_sect)))
{
bfd_perror ("bfd_get_section_contents");
free (core_text_space);
sym_sec = core_syms[i]->section;
symtab.limit->addr = core_syms[i]->value;
if (sym_sec)
- symtab.limit->addr += bfd_get_section_vma (sym_sec->owner, sym_sec);
+ symtab.limit->addr += bfd_section_vma (sym_sec);
if (found)
{
section containing the symbol, if available. */
min_vma = MIN (symtab.limit->addr, min_vma);
if (sym_sec)
- max_vma = MAX (bfd_get_section_vma (sym_sec->owner, sym_sec)
- + bfd_section_size (sym_sec->owner, sym_sec) - 1,
+ max_vma = MAX (bfd_section_vma (sym_sec)
+ + bfd_section_size (sym_sec) - 1,
max_vma);
else
max_vma = MAX (symtab.limit->addr, max_vma);
ltab.len = 0;
prev_line_num = 0;
- vma_high = core_text_sect->vma + bfd_get_section_size (core_text_sect);
+ vma_high = core_text_sect->vma + bfd_section_size (core_text_sect);
for (vma = core_text_sect->vma; vma < vma_high; vma += min_insn_size)
{
unsigned int len;
if (tab->len > 0 && dst[-1].end_addr == 0)
dst[-1].end_addr
- = core_text_sect->vma + bfd_get_section_size (core_text_sect) - 1;
+ = core_text_sect->vma + bfd_section_size (core_text_sect) - 1;
DBG (AOUTDEBUG | IDDEBUG,
printf ("[symtab_finalize]: removed %d duplicate entries\n",
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * ldcref.c, * ldctor.c, * ldelf.c, * ldlang.c, * pe-dll.c,
+ * emultempl/aarch64elf.em, * emultempl/aix.em,
+ * emultempl/armcoff.em, * emultempl/armelf.em,
+ * emultempl/cr16elf.em, * emultempl/cskyelf.em,
+ * emultempl/m68hc1xelf.em, * emultempl/m68kelf.em,
+ * emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
+ * emultempl/mmo.em, * emultempl/msp430.em,
+ * emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
+ * emultempl/ppc64elf.em, * emultempl/xtensaelf.em: Update
+ throughout for bfd section macro and function changes.
+
2019-09-18 Alan Modra <amodra@gmail.com>
* ldcref.c (check_reloc_refs): Update bfd_get_section to
/* Long branch stubs contain a 64-bit address, so the section requires
8 byte alignment. */
- bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
+ bfd_set_section_alignment (stub_sec, 3);
output_section = input_section->output_section;
os = lang_output_section_get (output_section);
if (is == NULL)
{
einfo (_("%F%P: can't find %s in output section\n"),
- bfd_get_section_name (sec->owner, sec));
+ bfd_section_name (sec));
}
/* Now figure out where the section should go. */
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
+ + bfd_section_vma (h->u.def.section->output_section)
+ h->u.def.section->output_offset);
val |= 1;
if (stub_sec == NULL)
goto err_ret;
- bfd_set_section_alignment (stub_file->the_bfd, stub_sec, alignment_power);
+ bfd_set_section_alignment (stub_sec, alignment_power);
os = lang_output_section_get (output_section);
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
+ + bfd_section_vma (h->u.def.section->output_section)
+ h->u.def.section->output_offset);
val |= 1;
relsec = bfd_make_section (abfd, ".emreloc");
if (relsec == NULL
- || ! bfd_set_section_flags (abfd, relsec,
- (SEC_ALLOC
- | SEC_LOAD
- | SEC_HAS_CONTENTS
- | SEC_IN_MEMORY))
- || ! bfd_set_section_alignment (abfd, relsec, 2)
- || ! bfd_set_section_size (abfd, relsec,
- datasec->reloc_count * 8))
+ || !bfd_set_section_flags (relsec, (SEC_ALLOC
+ | SEC_LOAD
+ | SEC_HAS_CONTENTS
+ | SEC_IN_MEMORY))
+ || !bfd_set_section_alignment (relsec, 2)
+ || !bfd_set_section_size (relsec, datasec->reloc_count * 8))
einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
}
static void
check_sections (bfd *abfd, asection *sec, void *datasec)
{
- if ((strncmp (bfd_get_section_name (abfd, sec), ".data.rel", 9) == 0)
+ if ((strncmp (bfd_section_name (sec), ".data.rel", 9) == 0)
&& sec != datasec
&& sec->reloc_count == 0 )
einfo (_("%X%P: %pB: section %s has relocs; can not use --embedded-relocs\n"),
- abfd, bfd_get_section_name (abfd, sec));
+ abfd, bfd_section_name (sec));
}
static void
if (stub_sec == NULL)
goto err_ret;
- bfd_set_section_alignment (stub_file->the_bfd, stub_sec, 3);
+ bfd_set_section_alignment (stub_sec, 3);
output_section = input_section->output_section;
- secname = bfd_get_section_name (output_section->owner, output_section);
+ secname = bfd_section_name (output_section);
os = lang_output_section_find (secname);
info.input_section = input_section;
case lang_input_section_enum:
if (l->input_section.section == info->input_section
- || strcmp (bfd_get_section_name (l->input_section.section->owner,
- l->input_section.section),
- bfd_get_section_name (info->input_section->owner,
- info->input_section)) == 0)
+ || strcmp (bfd_section_name (l->input_section.section),
+ bfd_section_name (info->input_section)) == 0)
{
/* We've found our section. Insert the stub immediately
before its associated input section. */
| SEC_HAS_CONTENTS
| SEC_IN_MEMORY));
if (relsec == NULL
- || ! bfd_set_section_alignment (abfd, relsec, 2)
- || ! bfd_set_section_size (abfd, relsec,
- datasec->reloc_count * 12))
+ || !bfd_set_section_alignment (relsec, 2)
+ || !bfd_set_section_size (relsec, datasec->reloc_count * 12))
einfo (_("%F%P: %pB: can not create .emreloc section: %E\n"));
}
static void
check_sections (bfd *abfd, asection *sec, void *datasec)
{
- if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
+ if ((bfd_section_flags (sec) & SEC_DATA)
&& sec != datasec
&& sec->reloc_count != 0)
einfo (_("%X%P: %pB: section %s has relocs; can not use --embedded-relocs\n"),
- abfd, bfd_get_section_name (abfd, sec));
+ abfd, bfd_section_name (sec));
}
#endif /* SUPPORT_EMBEDDED_RELOCS */
/* Set the flags. */
flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
| SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_KEEP);
- if (!bfd_set_section_flags (stub_bfd, stub_sec, flags))
+ if (!bfd_set_section_flags (stub_sec, flags))
goto err_ret;
os = lang_output_section_get (output_section);
}
/* Set vma to correspond to first such register number * 8. */
- bfd_set_section_vma (link_info.output_bfd, sec, (bfd_vma) regvma);
+ bfd_set_section_vma (sec, (bfd_vma) regvma);
/* Simplify symbol output for the register section (without contents;
created for register symbols) by setting the output offset to 0.
This section is only present when there are register symbols. */
sec = bfd_get_section_by_name (link_info.output_bfd, MMIX_REG_SECTION_NAME);
if (sec != NULL)
- bfd_set_section_vma (sec->owner, sec, 0);
+ bfd_set_section_vma (sec, 0);
if (!_bfd_mmix_after_linker_allocation (link_info.output_bfd, &link_info))
{
paper over the bug similarly. */
static void
-mmo_wipe_sec_reloc_flag (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
+mmo_wipe_sec_reloc_flag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
+ void *ptr ATTRIBUTE_UNUSED)
{
- bfd_set_section_flags (abfd, sec,
- bfd_get_section_flags (abfd, sec) & ~SEC_RELOC);
+ bfd_set_section_flags (sec, bfd_section_flags (sec) & ~SEC_RELOC);
}
/* Iterate with bfd_map_over_sections over mmo_wipe_sec_reloc_flag... */
}
static void
-add_region_prefix (bfd *abfd, asection *s,
- ATTRIBUTE_UNUSED void *unused)
+add_region_prefix (bfd *abfd ATTRIBUTE_UNUSED, asection *s,
+ void *unused ATTRIBUTE_UNUSED)
{
- const char *curr_name = bfd_get_section_name (abfd, s);
+ const char *curr_name = bfd_section_name (s);
int region = REGION_NONE;
if (strncmp (curr_name, ".text", 5) == 0)
case REGION_NONE:
break;
case REGION_UPPER:
- bfd_rename_section (abfd, s, concat (".upper", curr_name, NULL));
+ bfd_rename_section (s, concat (".upper", curr_name, NULL));
break;
case REGION_LOWER:
- bfd_rename_section (abfd, s, concat (".lower", curr_name, NULL));
+ bfd_rename_section (s, concat (".lower", curr_name, NULL));
break;
case REGION_EITHER:
s->name = concat (".either", curr_name, NULL);
}
static void
-eval_upper_either_sections (bfd *abfd, asection *s, void *data)
+eval_upper_either_sections (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *s, void *data)
{
const char * base_sec_name;
const char * curr_name;
return;
base_sec_name = (const char *) data;
- curr_name = bfd_get_section_name (abfd, s);
+ curr_name = bfd_section_name (s);
/* Only concerned with .either input sections in the upper output section. */
either_name = concat (".either", base_sec_name, NULL);
}
static void
-eval_lower_either_sections (bfd *abfd, asection *s, void *data)
+eval_lower_either_sections (bfd *abfd ATTRIBUTE_UNUSED,
+ asection *s, void *data)
{
const char * base_sec_name;
const char * curr_name;
return;
base_sec_name = (const char *) data;
- curr_name = bfd_get_section_name (abfd, s);
+ curr_name = bfd_section_name (s);
/* Only concerned with .either input sections in the lower or "default"
output section i.e. not in the upper output section. */
goto err_ret;
output_section = input_section->output_section;
- secname = bfd_get_section_name (output_section->owner, output_section);
+ secname = bfd_section_name (output_section);
os = lang_output_section_find (secname);
info.input_section = input_section;
/* Special procesing is required for a Thumb entry symbol. The
bottom bit of its address must be set. */
val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
+ + bfd_section_vma (h->u.def.section->output_section)
+ h->u.def.section->output_offset);
val |= 1;
ls = &(*pl)->input_section;
- lname = bfd_get_section_name (ls->section->owner, ls->section);
+ lname = bfd_section_name (ls->section);
if (strchr (lname, '\$') != NULL
&& (dollar == NULL || strcmp (orig_secname, lname) < 0))
break;
ls = &(*pl)->input_section;
- lname = bfd_get_section_name (ls->section->owner, ls->section);
+ lname = bfd_section_name (ls->section);
if (strchr (lname, '\$') != NULL
&& (dollar == NULL || strcmp (orig_secname, lname) < 0))
break;
stub_sec = bfd_make_section_anyway_with_flags (stub_file->the_bfd,
stub_sec_name, flags);
if (stub_sec == NULL
- || !bfd_set_section_alignment (stub_file->the_bfd, stub_sec,
- (params.plt_stub_align > 5
- ? params.plt_stub_align
- : params.plt_stub_align < -5
- ? -params.plt_stub_align
- : 5)))
+ || !bfd_set_section_alignment (stub_sec, (params.plt_stub_align > 5
+ ? params.plt_stub_align
+ : params.plt_stub_align < -5
+ ? -params.plt_stub_align
+ : 5)))
goto err_ret;
output_section = input_section->output_section;
/* Create a property table section for it. */
prop_sec_name = strdup (prop_sec_name);
prop_sec = bfd_make_section_with_flags
- (abfd, prop_sec_name, bfd_get_section_flags (abfd, insn_sec));
+ (abfd, prop_sec_name, bfd_section_flags (insn_sec));
if (prop_sec == NULL
- || ! bfd_set_section_alignment (abfd, prop_sec, 2))
+ || !bfd_set_section_alignment (prop_sec, 2))
{
*error_message = _("could not create new section");
goto cleanup;
char *owned_prop_sec_name = NULL;
const char *sec_name;
- sec_name = bfd_get_section_name (abfd, sec);
+ sec_name = bfd_section_name (sec);
if (strcmp (sec_name, INSN_SEC_BASE_NAME) == 0)
{
insn_sec_name = INSN_SEC_BASE_NAME;
is_inconsistent_linkonce_section (asection *sec)
{
bfd *abfd = sec->owner;
- const char *sec_name = bfd_get_section_name (abfd, sec);
+ const char *sec_name = bfd_section_name (sec);
const char *name;
- if ((bfd_get_section_flags (abfd, sec) & SEC_LINK_ONCE) == 0
+ if ((bfd_section_flags (sec) & SEC_LINK_ONCE) == 0
|| strncmp (sec_name, ".gnu.linkonce.", linkonce_len) != 0)
return FALSE;
defsec = hl->u.def.section->output_section;
if (defsec == NULL)
return TRUE;
- defsecname = bfd_get_section_name (defsec->owner, defsec);
+ defsecname = bfd_section_name (defsec);
for (ncrs = nocrossref_list; ncrs != NULL; ncrs = ncrs->next)
for (ncr = ncrs->list; ncr != NULL; ncr = ncr->next)
arelent **p, **pend;
outsec = sec->output_section;
- outsecname = bfd_get_section_name (outsec->owner, outsec);
+ outsecname = bfd_section_name (outsec);
outdefsec = info->defsec->output_section;
- outdefsecname = bfd_get_section_name (outdefsec->owner, outdefsec);
+ outdefsecname = bfd_section_name (outdefsec);
/* The section where the symbol is defined is permitted. */
if (strcmp (outsecname, outdefsecname) == 0)
/* See PR 20911 for a reproducer. */
if (p->elements->section->owner == NULL)
einfo (_("%X%P: special section %s does not support reloc %s for set %s\n"),
- bfd_get_section_name (link_info.output_bfd, p->elements->section),
+ bfd_section_name (p->elements->section),
bfd_get_reloc_code_name (p->reloc),
p->h->root.string);
else
for (s = abfd->sections; s && type < COMPACT_EH_HDR; s = s->next)
{
- const char *name = bfd_get_section_name (abfd, s);
+ const char *name = bfd_section_name (s);
if (bfd_is_abs_section (s->output_section))
continue;
bed->dynamic_sec_flags
| SEC_READONLY);
if (s != NULL
- && bfd_set_section_alignment (elfbfd, s, 2))
+ && bfd_set_section_alignment (s, 2))
{
htab->eh_info.hdr_sec = s;
warn_eh_frame = FALSE;
flags = (SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY
| SEC_LINKER_CREATED | SEC_READONLY | SEC_DATA);
s = bfd_make_section_with_flags (ibfd, ".note.gnu.build-id", flags);
- if (s != NULL && bfd_set_section_alignment (ibfd, s, 2))
+ if (s != NULL && bfd_set_section_alignment (s, 2))
{
struct elf_obj_tdata *t = elf_tdata (link_info.output_bfd);
t->o->build_id.after_write_object_contents = &write_build_id;
if (sec->spec.name != NULL)
{
- const char *sname = bfd_get_section_name (file->the_bfd, s);
+ const char *sname = bfd_section_name (s);
skip = name_match (sec->spec.name, sname) != 0;
}
abort ();
case by_init_priority:
- ainit_priority
- = get_init_priority (bfd_get_section_name (asec->owner, asec));
- binit_priority
- = get_init_priority (bfd_get_section_name (bsec->owner, bsec));
+ ainit_priority = get_init_priority (bfd_section_name (asec));
+ binit_priority = get_init_priority (bfd_section_name (bsec));
if (ainit_priority == 0 || binit_priority == 0)
goto sort_by_name;
ret = ainit_priority - binit_priority;
goto sort_by_name;
case by_alignment_name:
- ret = (bfd_section_alignment (bsec->owner, bsec)
- - bfd_section_alignment (asec->owner, asec));
+ ret = bfd_section_alignment (bsec) - bfd_section_alignment (asec);
if (ret)
break;
/* Fall through. */
case by_name:
sort_by_name:
- ret = strcmp (bfd_get_section_name (asec->owner, asec),
- bfd_get_section_name (bsec->owner, bsec));
+ ret = strcmp (bfd_section_name (asec), bfd_section_name (bsec));
break;
case by_name_alignment:
- ret = strcmp (bfd_get_section_name (asec->owner, asec),
- bfd_get_section_name (bsec->owner, bsec));
+ ret = strcmp (bfd_section_name (asec), bfd_section_name (bsec));
if (ret)
break;
/* Fall through. */
case by_alignment:
- ret = (bfd_section_alignment (bsec->owner, bsec)
- - bfd_section_alignment (asec->owner, asec));
+ ret = bfd_section_alignment (bsec) - bfd_section_alignment (asec);
break;
}
for (s = file->the_bfd->sections; s != NULL; s = s->next)
{
- const char *sname = bfd_get_section_name (file->the_bfd, s);
+ const char *sname = bfd_section_name (s);
bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname);
if (!skip)
walk_wild_consider_section (ptr, file, s, sec0, callback, data);
else
{
- const char *sname = bfd_get_section_name (file->the_bfd, s);
+ const char *sname = bfd_section_name (s);
bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
if (!skip)
walk_wild_consider_section (ptr, file, s, sec0, callback, data);
else
{
- const char *sname = bfd_get_section_name (file->the_bfd, s);
+ const char *sname = bfd_section_name (s);
bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname);
if (!skip)
walk_wild_consider_section (ptr, file, s, sec1, callback, data);
else
{
- const char *sname = bfd_get_section_name (file->the_bfd, s);
+ const char *sname = bfd_section_name (s);
bfd_boolean skip = !match_simple_wild (wildsec2->spec.name,
sname);
" section %s\n"), os->name);
input = os->children.head->input_section.section;
- bfd_set_section_vma (os->bfd_section->owner,
- os->bfd_section,
- bfd_section_vma (input->owner, input));
+ bfd_set_section_vma (os->bfd_section,
+ bfd_section_vma (input));
if (!(os->bfd_section->flags & SEC_FIXED_SIZE))
os->bfd_section->size = input->size;
break;
if (command_line.check_section_addresses)
einfo (_("%F%P: error: no memory region specified"
" for loadable section `%s'\n"),
- bfd_get_section_name (link_info.output_bfd,
- os->bfd_section));
+ bfd_section_name (os->bfd_section));
else
einfo (_("%P: warning: no memory region specified"
" for loadable section `%s'\n"),
- bfd_get_section_name (link_info.output_bfd,
- os->bfd_section));
+ bfd_section_name (os->bfd_section));
}
newdot = os->region->current;
os->name, (unsigned long) dotdelta);
}
- bfd_set_section_vma (0, os->bfd_section, newdot);
+ bfd_set_section_vma (os->bfd_section, newdot);
os->bfd_section->output_offset = 0;
}
bfd_vma val;
val = (h->u.def.value
- + bfd_get_section_vma (link_info.output_bfd,
- h->u.def.section->output_section)
+ + bfd_section_vma (h->u.def.section->output_section)
+ h->u.def.section->output_offset);
if (!bfd_set_start_address (link_info.output_bfd, val))
einfo (_("%F%P: %s: can't set start address\n"), entry_symbol.name);
einfo (_("%P: warning: cannot find entry symbol %s;"
" defaulting to %V\n"),
entry_symbol.name,
- bfd_get_section_vma (link_info.output_bfd, ts));
- if (!(bfd_set_start_address
- (link_info.output_bfd,
- bfd_get_section_vma (link_info.output_bfd, ts))))
+ bfd_section_vma (ts));
+ if (!bfd_set_start_address (link_info.output_bfd,
+ bfd_section_vma (ts)))
einfo (_("%F%P: can't set start address\n"));
}
else
{
edata_s = bfd_make_section_old_way (filler_bfd, ".edata");
if (edata_s == NULL
- || !bfd_set_section_flags (filler_bfd, edata_s,
- (SEC_HAS_CONTENTS
- | SEC_ALLOC
- | SEC_LOAD
- | SEC_KEEP
- | SEC_IN_MEMORY)))
+ || !bfd_set_section_flags (edata_s, (SEC_HAS_CONTENTS
+ | SEC_ALLOC
+ | SEC_LOAD
+ | SEC_KEEP
+ | SEC_IN_MEMORY)))
{
einfo (_("%X%P: can not create .edata section: %E\n"));
return;
}
- bfd_set_section_size (filler_bfd, edata_s, edata_sz);
+ bfd_set_section_size (edata_s, edata_sz);
}
reloc_s = bfd_make_section_old_way (filler_bfd, ".reloc");
if (reloc_s == NULL
- || !bfd_set_section_flags (filler_bfd, reloc_s,
- (SEC_HAS_CONTENTS
- | SEC_ALLOC
- | SEC_LOAD
- | SEC_KEEP
- | SEC_IN_MEMORY)))
+ || !bfd_set_section_flags (reloc_s, (SEC_HAS_CONTENTS
+ | SEC_ALLOC
+ | SEC_LOAD
+ | SEC_KEEP
+ | SEC_IN_MEMORY)))
{
einfo (_("%X%P: can not create .reloc section: %E\n"));
return;
}
- bfd_set_section_size (filler_bfd, reloc_s, 0);
+ bfd_set_section_size (reloc_s, 0);
ldlang_add_file (filler_file);
}
{
arelent **relocs;
int relsize, nrelocs, i;
- int flags = bfd_get_section_flags (b, s);
+ int flags = bfd_section_flags (s);
/* Skip discarded linkonce sections. */
if (flags & SEC_LINK_ONCE
asymbol *sym;
sec = bfd_make_section_old_way (abfd, name);
- bfd_set_section_flags (abfd, sec, flags | SEC_ALLOC | SEC_LOAD | SEC_KEEP);
- bfd_set_section_alignment (abfd, sec, align);
+ bfd_set_section_flags (sec, flags | SEC_ALLOC | SEC_LOAD | SEC_KEEP);
+ bfd_set_section_alignment (sec, align);
/* Remember to undo this before trying to link internally! */
sec->output_section = sec;
pointer to the list points to the *end* of this section, which is
the start of the list of sections from other objects. */
- bfd_set_section_size (abfd, id2, 20);
+ bfd_set_section_size (id2, 20);
d2 = xmalloc (20);
id2->contents = d2;
memset (d2, 0, 20);
save_relocs (id2);
if (pe_use_nul_prefixed_import_tables)
- bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
+ bfd_set_section_size (id5, PE_IDATA5_SIZE);
else
- bfd_set_section_size (abfd, id5, 0);
+ bfd_set_section_size (id5, 0);
d5 = xmalloc (PE_IDATA5_SIZE);
id5->contents = d5;
memset (d5, 0, PE_IDATA5_SIZE);
if (pe_use_nul_prefixed_import_tables)
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
+ bfd_set_section_size (id4, PE_IDATA4_SIZE);
else
- bfd_set_section_size (abfd, id4, 0);
+ bfd_set_section_size (id4, 0);
d4 = xmalloc (PE_IDATA4_SIZE);
id4->contents = d4;
memset (d4, 0, PE_IDATA4_SIZE);
id7 = quick_section (abfd, ".idata$7", SEC_HAS_CONTENTS, 2);
quick_symbol (abfd, U (""), dll_symname, "_iname", id7, BSF_GLOBAL, 0);
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
+ bfd_set_section_size (id4, PE_IDATA4_SIZE);
d4 = xmalloc (PE_IDATA4_SIZE);
id4->contents = d4;
memset (d4, 0, PE_IDATA4_SIZE);
- bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
+ bfd_set_section_size (id5, PE_IDATA5_SIZE);
d5 = xmalloc (PE_IDATA5_SIZE);
id5->contents = d5;
memset (d5, 0, PE_IDATA5_SIZE);
len = strlen (dll_filename) + 1;
if (len & 1)
len++;
- bfd_set_section_size (abfd, id7, len);
+ bfd_set_section_size (id7, len);
d7 = xmalloc (len);
id7->contents = d7;
strcpy ((char *) d7, dll_filename);
if (include_jmp_stub)
{
- bfd_set_section_size (abfd, tx, jmp_byte_count);
+ bfd_set_section_size (tx, jmp_byte_count);
td = xmalloc (jmp_byte_count);
tx->contents = td;
memcpy (td, jmp_bytes, jmp_byte_count);
save_relocs (tx);
}
else
- bfd_set_section_size (abfd, tx, 0);
+ bfd_set_section_size (tx, 0);
- bfd_set_section_size (abfd, id7, 4);
+ bfd_set_section_size (id7, 4);
d7 = xmalloc (4);
id7->contents = d7;
memset (d7, 0, 4);
quick_reloc (abfd, 0, BFD_RELOC_RVA, 5);
save_relocs (id7);
- bfd_set_section_size (abfd, id5, PE_IDATA5_SIZE);
+ bfd_set_section_size (id5, PE_IDATA5_SIZE);
d5 = xmalloc (PE_IDATA5_SIZE);
id5->contents = d5;
memset (d5, 0, PE_IDATA5_SIZE);
save_relocs (id5);
}
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE);
+ bfd_set_section_size (id4, PE_IDATA4_SIZE);
d4 = xmalloc (PE_IDATA4_SIZE);
id4->contents = d4;
memset (d4, 0, PE_IDATA4_SIZE);
if (exp->flag_noname)
{
len = 0;
- bfd_set_section_size (abfd, id6, 0);
+ bfd_set_section_size (id6, 0);
}
else
{
len = 2 + strlen (exp->name) + 1;
if (len & 1)
len++;
- bfd_set_section_size (abfd, id6, len);
+ bfd_set_section_size (id6, len);
d6 = xmalloc (len);
id6->contents = d6;
memset (d6, 0, len);
quick_symbol (abfd, "__nm_", import, "", UNDSEC, BSF_GLOBAL, 0);
/* We need space for the real thunk and for the null terminator. */
- bfd_set_section_size (abfd, id4, PE_IDATA4_SIZE * 2);
+ bfd_set_section_size (id4, PE_IDATA4_SIZE * 2);
d4 = xmalloc (PE_IDATA4_SIZE * 2);
id4->contents = d4;
memset (d4, 0, PE_IDATA4_SIZE * 2);
quick_symbol (abfd, U (""), symname, "_iname", UNDSEC, BSF_GLOBAL, 0);
quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
- bfd_set_section_size (abfd, id2, 20);
+ bfd_set_section_size (id2, 20);
d2 = xmalloc (20);
id2->contents = d2;
memset (d2, 0, 20);
quick_symbol (abfd, "__imp_", name, "", UNDSEC, BSF_GLOBAL, 0);
- bfd_set_section_size (abfd, rt_rel, size);
+ bfd_set_section_size (rt_rel, size);
rt_rel_d = xmalloc (size);
rt_rel->contents = rt_rel_d;
memset (rt_rel_d, 0, size);
}
else
{
- bfd_set_section_size (abfd, rt_rel, 8);
+ bfd_set_section_size (rt_rel, 8);
rt_rel_d = xmalloc (8);
rt_rel->contents = rt_rel_d;
memset (rt_rel_d, 0, 8);
quick_symbol (abfd, "", U ("_pei386_runtime_relocator"), "", UNDSEC,
BSF_NO_FLAGS, 0);
- bfd_set_section_size (abfd, extern_rt_rel, PE_IDATA5_SIZE);
+ bfd_set_section_size (extern_rt_rel, PE_IDATA5_SIZE);
extern_rt_rel_d = xcalloc (1, PE_IDATA5_SIZE);
extern_rt_rel->contents = extern_rt_rel_d;
generate_reloc (abfd, info);
if (reloc_sz > 0)
{
- bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
+ bfd_set_section_size (reloc_s, reloc_sz);
/* Resize the sections. */
lang_reset_memory_regions ();
generate_reloc (abfd, info);
if (reloc_sz > 0)
{
- bfd_set_section_size (filler_bfd, reloc_s, reloc_sz);
+ bfd_set_section_size (reloc_s, reloc_sz);
/* Resize the sections. */
lang_reset_memory_regions ();
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * ctf-open-bfd.c: Update throughout for bfd section macro changes.
+
2019-09-09 Phil Blundell <pb@pbcl.net>
binutils 2.33 branch created.
ctfsect.cts_name = _CTF_SECTION;
ctfsect.cts_entsize = 1;
- ctfsect.cts_size = bfd_section_size (abfd, ctf_asect);
+ ctfsect.cts_size = bfd_section_size (ctf_asect);
ctfsect.cts_data = contents;
if ((arc = ctf_bfdopen_ctfsect (abfd, &ctfsect, errp)) != NULL)
}
strsect.cts_data = contents;
strsect.cts_name = (char *) strsect.cts_data + strhdr->sh_name;
- strsect.cts_size = bfd_section_size (abfd, str_asect);
+ strsect.cts_size = bfd_section_size (str_asect);
strsect.cts_entsize = strhdr->sh_size;
strsectp = &strsect;
symsect.cts_name = (char *) strsect.cts_data + symhdr->sh_name;
symsect.cts_entsize = symhdr->sh_size;
- symsect.cts_size = bfd_section_size (abfd, sym_asect);
+ symsect.cts_size = bfd_section_size (sym_asect);
symsect.cts_data = contents;
symsectp = &symsect;
}
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * arc-ext.c: Update throughout for bfd section macro changes.
+
2019-09-18 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Re-generate.
sizeof (".gnu.linkonce.arcextmap.") - 1)
|| !strcmp (sect->name,".arcextmap"))
{
- bfd_size_type count = bfd_get_section_size (sect);
+ bfd_size_type count = bfd_section_size (sect);
unsigned char* buffer = xmalloc (count);
if (buffer)
+2019-09-18 Alan Modra <amodra@gmail.com>
+
+ * common/sim-load.c, * common/sim-utils.c, * cris/sim-if.c,
+ * erc32/func.c, * lm32/sim-if.c, * m32c/load.c, * m32c/trace.c,
+ * m68hc11/interp.c, * ppc/hw_htab.c, * ppc/hw_init.c,
+ * rl78/load.c, * rl78/trace.c, * rx/gdb-if.c, * rx/load.c,
+ * rx/trace.c: Update throughout for bfd section macro changes.
+
2019-06-13 Stafford Horne <shorne@gmail.com>
* or1k/cpu.c: Regenerate.
{
bfd_size_type size;
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
if (size > 0)
{
unsigned char *buffer;
return NULL;
}
if (lma_p)
- lma = bfd_section_lma (result_bfd, s);
+ lma = bfd_section_lma (s);
else
- lma = bfd_section_vma (result_bfd, s);
+ lma = bfd_section_vma (s);
if (verbose_p)
{
xprintf (callback, "Loading section %s, size 0x%lx %s ",
- bfd_get_section_name (result_bfd, s),
+ bfd_section_name (s),
(unsigned long) size,
(lma_p ? "lma" : "vma"));
xprintf_bfd_vma (callback, lma);
STATE_START_ADDR (sd) = bfd_get_start_address (prog_bfd);
for (s = prog_bfd->sections; s; s = s->next)
- if (strcmp (bfd_get_section_name (prog_bfd, s), ".text") == 0)
+ if (strcmp (bfd_section_name (s), ".text") == 0)
{
STATE_TEXT_SECTION (sd) = s;
- STATE_TEXT_START (sd) = bfd_get_section_vma (prog_bfd, s);
- STATE_TEXT_END (sd) = STATE_TEXT_START (sd) + bfd_section_size (prog_bfd, s);
+ STATE_TEXT_START (sd) = bfd_section_vma (s);
+ STATE_TEXT_END (sd) = STATE_TEXT_START (sd) + bfd_section_size (s);
break;
}
SIM_DESC sd = p->sd;
int offset = p->offset;
- if ((bfd_get_section_flags (abfd, s) & SEC_ALLOC))
+ if ((bfd_section_flags (s) & SEC_ALLOC))
{
- bfd_vma vma = bfd_get_section_vma (abfd, s);
+ bfd_vma vma = bfd_section_vma (s);
- bfd_set_section_vma (abfd, s, vma + offset);
+ bfd_set_section_vma (s, vma + offset);
}
/* This seems clumsy and inaccurate, but let's stick to doing it the
same way as sim_analyze_program for consistency. */
- if (strcmp (bfd_get_section_name (abfd, s), ".text") == 0)
- STATE_TEXT_START (sd) = bfd_get_section_vma (abfd, s);
+ if (strcmp (bfd_section_name (s), ".text") == 0)
+ STATE_TEXT_START (sd) = bfd_section_vma (s);
}
/* Adjust the start-address, LMA and VMA of a SD. Must be called
{
struct progbounds *pbp = (struct progbounds *) vp;
- if ((bfd_get_section_flags (abfd, s) & SEC_ALLOC))
+ if ((bfd_section_flags (s) & SEC_ALLOC))
{
- bfd_size_type sec_size = bfd_get_section_size (s);
- bfd_size_type sec_start = bfd_get_section_vma (abfd, s);
+ bfd_size_type sec_size = bfd_section_size (s);
+ bfd_size_type sec_start = bfd_section_vma (s);
bfd_size_type sec_end = sec_start + sec_size;
if (sec_end > pbp->endmem)
if (sec_start < pbp->startmem)
pbp->startmem = sec_start;
- if ((bfd_get_section_flags (abfd, s) & SEC_LOAD))
+ if ((bfd_section_flags (s) & SEC_LOAD))
{
if (sec_end > pbp->end_loadmem)
pbp->end_loadmem = sec_end;
if (sis_verbose)
printf("loading %s:", fname);
for (section = pbfd->sections; section; section = section->next) {
- if (bfd_get_section_flags(pbfd, section) & SEC_ALLOC) {
+ if (bfd_section_flags (section) & SEC_ALLOC) {
bfd_vma section_address;
unsigned long section_size;
const char *section_name;
- section_name = bfd_get_section_name(pbfd, section);
+ section_name = bfd_section_name (section);
- section_address = bfd_get_section_vma(pbfd, section);
+ section_address = bfd_section_vma (section);
/*
* Adjust sections from a.out files, since they don't carry their
* addresses with.
}
}
- section_size = bfd_section_size(pbfd, section);
+ section_size = bfd_section_size (section);
if (sis_verbose)
printf("\nsection %s at 0x%08lx (0x%lx bytes)",
section_name, section_address, section_size);
/* Text, data or lit */
- if (bfd_get_section_flags(pbfd, section) & SEC_LOAD) {
+ if (bfd_section_flags (section) & SEC_LOAD) {
file_ptr fptr;
fptr = 0;
found = 0;
for (s = prog_bfd->sections; s; s = s->next)
{
- if ((strcmp (bfd_get_section_name (prog_bfd, s), ".boot") == 0)
- || (strcmp (bfd_get_section_name (prog_bfd, s), ".text") == 0)
- || (strcmp (bfd_get_section_name (prog_bfd, s), ".data") == 0)
- || (strcmp (bfd_get_section_name (prog_bfd, s), ".bss") == 0))
+ if ((strcmp (bfd_section_name (s), ".boot") == 0)
+ || (strcmp (bfd_section_name (s), ".text") == 0)
+ || (strcmp (bfd_section_name (s), ".data") == 0)
+ || (strcmp (bfd_section_name (s), ".bss") == 0))
{
if (!found)
{
- base = bfd_get_section_vma (prog_bfd, s);
+ base = bfd_section_vma (s);
found = 1;
}
else
- base =
- bfd_get_section_vma (prog_bfd,
- s) < base ? bfd_get_section_vma (prog_bfd,
- s) : base;
+ base = bfd_section_vma (s) < base ? bfd_section_vma (s) : base;
}
}
return base & ~(0xffffUL);
remains as a reminder. */
if ((s->flags & SEC_ALLOC) && !(s->flags & SEC_READONLY))
{
- if (strcmp (bfd_get_section_name (prog, s), ".stack"))
+ if (strcmp (bfd_section_name (s), ".stack"))
{
int secend =
- bfd_get_section_size (s) + bfd_section_lma (prog, s);
- if (heaptop < secend && bfd_section_lma (prog, s) < 0x10000)
+ bfd_section_size (s) + bfd_section_lma (s);
+ if (heaptop < secend && bfd_section_lma (s) < 0x10000)
{
heaptop = heapbottom = secend;
}
bfd_size_type size;
bfd_vma base;
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
if (size <= 0)
continue;
- base = bfd_section_lma (prog, s);
+ base = bfd_section_lma (s);
if (verbose)
fprintf (stderr, "[load a=%08x s=%08x %s]\n",
- (int) base, (int) size, bfd_get_section_name (prog, s));
+ (int) base, (int) size, bfd_section_name (s));
buf = (char *) malloc (size);
bfd_get_section_contents (prog, s, buf, 0, size);
mem_put_blk (base, buf, size);
if (s->flags & SEC_CODE || code_section == 0)
{
code_section = s;
- code_base = bfd_section_lma (current_bfd, s);
+ code_base = bfd_section_lma (s);
break;
}
}
{
bfd_size_type size;
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
if (size > 0)
{
bfd_vma lma;
if (STATE_LOAD_AT_LMA_P (sd))
- lma = bfd_section_lma (abfd, s);
+ lma = bfd_section_lma (s);
else
- lma = bfd_section_vma (abfd, s);
+ lma = bfd_section_vma (s);
if (lma <= 0xFFFE && lma+size >= 0x10000)
cpu->cpu_use_elf_start = 0;
PTR data)
{
htab_binary_sizes *sizes = (htab_binary_sizes*)data;
- unsigned_word size = bfd_get_section_size (sec);
- unsigned_word vma = bfd_get_section_vma (abfd, sec);
- unsigned_word ra = bfd_get_section_lma (abfd, sec);
+ unsigned_word size = bfd_section_size (sec);
+ unsigned_word vma = bfd_section_vma (sec);
+ unsigned_word ra = bfd_section_lma (sec);
/* skip the section if no memory to allocate */
- if (! (bfd_get_section_flags(abfd, sec) & SEC_ALLOC))
+ if (! (bfd_section_flags (sec) & SEC_ALLOC))
return;
- if ((bfd_get_section_flags (abfd, sec) & SEC_CODE)
- || (bfd_get_section_flags (abfd, sec) & SEC_READONLY)) {
+ if ((bfd_section_flags (sec) & SEC_CODE)
+ || (bfd_section_flags (sec) & SEC_READONLY)) {
if (sizes->text_bound < vma + size)
sizes->text_bound = ALIGN_PAGE(vma + size);
if (sizes->text_base > vma)
if (sizes->text_ra > ra)
sizes->text_ra = FLOOR_PAGE(ra);
}
- else if ((bfd_get_section_flags (abfd, sec) & SEC_DATA)
- || (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)) {
+ else if ((bfd_section_flags (sec) & SEC_DATA)
+ || (bfd_section_flags (sec) & SEC_ALLOC)) {
if (sizes->data_bound < vma + size)
sizes->data_bound = ALIGN_PAGE(vma + size);
if (sizes->data_base > vma)
device *me = sizes->me;
/* skip the section if no memory to allocate */
- if (! (bfd_get_section_flags(abfd, sec) & SEC_ALLOC))
+ if (! (bfd_section_flags (sec) & SEC_ALLOC))
return;
/* check/ignore any sections of size zero */
- section_size = bfd_get_section_size (sec);
+ section_size = bfd_section_size (sec);
if (section_size == 0)
return;
/* if nothing to load, ignore this one */
- if (! (bfd_get_section_flags(abfd, sec) & SEC_LOAD))
+ if (! (bfd_section_flags (sec) & SEC_LOAD))
return;
/* find where it is to go */
- section_vma = bfd_get_section_vma(abfd, sec);
+ section_vma = bfd_section_vma (sec);
section_ra = 0;
- if ((bfd_get_section_flags (abfd, sec) & SEC_CODE)
- || (bfd_get_section_flags (abfd, sec) & SEC_READONLY))
+ if ((bfd_section_flags (sec) & SEC_CODE)
+ || (bfd_section_flags (sec) & SEC_READONLY))
section_ra = (section_vma - sizes->text_base + sizes->text_ra);
- else if ((bfd_get_section_flags (abfd, sec) & SEC_DATA))
+ else if ((bfd_section_flags (sec) & SEC_DATA))
section_ra = (section_vma - sizes->data_base + sizes->data_ra);
else
return; /* just ignore it */
DTRACE(htab,
("load - name=%-7s vma=0x%.8lx size=%6ld ra=0x%.8lx flags=%3lx(%s%s%s%s%s )\n",
- bfd_get_section_name(abfd, sec),
+ bfd_section_name (sec),
(long)section_vma,
(long)section_size,
(long)section_ra,
- (long)bfd_get_section_flags(abfd, sec),
- bfd_get_section_flags(abfd, sec) & SEC_LOAD ? " LOAD" : "",
- bfd_get_section_flags(abfd, sec) & SEC_CODE ? " CODE" : "",
- bfd_get_section_flags(abfd, sec) & SEC_DATA ? " DATA" : "",
- bfd_get_section_flags(abfd, sec) & SEC_ALLOC ? " ALLOC" : "",
- bfd_get_section_flags(abfd, sec) & SEC_READONLY ? " READONLY" : ""
+ (long)bfd_section_flags (sec),
+ bfd_section_flags (sec) & SEC_LOAD ? " LOAD" : "",
+ bfd_section_flags (sec) & SEC_CODE ? " CODE" : "",
+ bfd_section_flags (sec) & SEC_DATA ? " DATA" : "",
+ bfd_section_flags (sec) & SEC_ALLOC ? " ALLOC" : "",
+ bfd_section_flags (sec) & SEC_READONLY ? " READONLY" : ""
));
/* dma in the sections data */
device *me = (device*)obj;
/* skip the section if no memory to allocate */
- if (! (bfd_get_section_flags(abfd, the_section) & SEC_ALLOC))
+ if (! (bfd_section_flags (the_section) & SEC_ALLOC))
return;
/* check/ignore any sections of size zero */
- section_size = bfd_get_section_size (the_section);
+ section_size = bfd_section_size (the_section);
if (section_size == 0)
return;
/* find where it is to go */
- section_vma = bfd_get_section_vma(abfd, the_section);
+ section_vma = bfd_section_vma (the_section);
DTRACE(binary,
("name=%-7s, vma=0x%.8lx, size=%6ld, flags=%3lx(%s%s%s%s%s )\n",
- bfd_get_section_name(abfd, the_section),
+ bfd_section_name (the_section),
(long)section_vma,
(long)section_size,
- (long)bfd_get_section_flags(abfd, the_section),
- bfd_get_section_flags(abfd, the_section) & SEC_LOAD ? " LOAD" : "",
- bfd_get_section_flags(abfd, the_section) & SEC_CODE ? " CODE" : "",
- bfd_get_section_flags(abfd, the_section) & SEC_DATA ? " DATA" : "",
- bfd_get_section_flags(abfd, the_section) & SEC_ALLOC ? " ALLOC" : "",
- bfd_get_section_flags(abfd, the_section) & SEC_READONLY ? " READONLY" : ""
+ (long)bfd_section_flags (the_section),
+ bfd_section_flags (the_section) & SEC_LOAD ? " LOAD" : "",
+ bfd_section_flags (the_section) & SEC_CODE ? " CODE" : "",
+ bfd_section_flags (the_section) & SEC_DATA ? " DATA" : "",
+ bfd_section_flags (the_section) & SEC_ALLOC ? " ALLOC" : "",
+ bfd_section_flags (the_section) & SEC_READONLY ? " READONLY" : ""
));
/* If there is an .interp section, it means it needs a shared library interpreter. */
- if (strcmp(".interp", bfd_get_section_name(abfd, the_section)) == 0)
+ if (strcmp(".interp", bfd_section_name (the_section)) == 0)
error("Shared libraries are not yet supported.\n");
/* determine the devices access */
access = access_read;
- if (bfd_get_section_flags(abfd, the_section) & SEC_CODE)
+ if (bfd_section_flags (the_section) & SEC_CODE)
access |= access_exec;
- if (!(bfd_get_section_flags(abfd, the_section) & SEC_READONLY))
+ if (!(bfd_section_flags (the_section) & SEC_READONLY))
access |= access_write;
/* if claim specified, allocate region from the memory device */
me);
/* if a load dma in the required data */
- if (bfd_get_section_flags(abfd, the_section) & SEC_LOAD) {
+ if (bfd_section_flags (the_section) & SEC_LOAD) {
void *section_init = zalloc(section_size);
if (!bfd_get_section_contents(abfd,
the_section,
for (s = abfd->sections; s; s = s->next)
if (s->filepos == filepos)
- return bfd_get_section_name (abfd, s);
+ return bfd_section_name (s);
return "(unknown)";
}
if (s->flags & SEC_CODE || code_section == 0)
{
code_section = s;
- code_base = bfd_section_lma (current_bfd, s);
+ code_base = bfd_section_lma (s);
break;
}
}
struct swap_list *sl;
bfd_size_type size;
- size = bfd_get_section_size (s);
+ size = bfd_section_size (s);
if (size <= 0)
continue;
sl = malloc (sizeof (struct swap_list));
assert (sl != NULL);
sl->next = swap_list;
- sl->start = bfd_section_lma (abfd, s);
+ sl->start = bfd_section_lma (s);
sl->end = sl->start + size;
swap_list = sl;
}
for (s = abfd->sections; s; s = s->next)
if (s->filepos == filepos)
- return bfd_get_section_name (abfd, s);
+ return bfd_section_name (s);
return "(unknown)";
}
if (s->flags & SEC_CODE || code_section == 0)
{
code_section = s;
- code_base = bfd_section_lma (current_bfd, s);
+ code_base = bfd_section_lma (s);
break;
}
}