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
+ | SEC_OCTETS));
+ 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;
const relax_typeS *table;
target = fragP->fr_offset;
- address = fragP->fr_address;
+ address = fragP->fr_address + fragP->fr_fix;
table = TC_GENERIC_RELAX_TABLE;
this_state = fragP->fr_subtype;
start_type = this_type = table + this_state;
negative. Don't allow this in case the negative reach is
large enough to require a larger branch instruction. */
else if (target < address)
- target = fragP->fr_next->fr_address + stretch;
+ return 0;
}
}
- aim = target - address - fragP->fr_fix;
+ aim = target - address;
#ifdef TC_PCREL_ADJUST
- /* Currently only the ns32k family needs this. */
+ /* Currently only the ns32k and arc needs this. */
aim += TC_PCREL_ADJUST (fragP);
#endif