aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-alpha.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-10-05 17:48:32 +0000
committerIan Lance Taylor <ian@airs.com>1995-10-05 17:48:32 +0000
commitaca736871c2567ee38bd285afdff62d6339790e4 (patch)
treec985ff5eac4c2120cf4818d4a1a42698120ec980 /bfd/coff-alpha.c
parent90ce63bb0e3d8e855bcffd8ecf9adca4a3b2cd6e (diff)
downloadgdb-aca736871c2567ee38bd285afdff62d6339790e4.zip
gdb-aca736871c2567ee38bd285afdff62d6339790e4.tar.gz
gdb-aca736871c2567ee38bd285afdff62d6339790e4.tar.bz2
* libecoff.h (struct ecoff_backend_data): Add adjust_headers
field. * ecoff.c (ecoff_sec_to_styp_flags): Check for various Alpha sections, and set styp correctly for them: .got, .hash, .dynamic, .liblist, .rel.dyn, .conflic, .dynstr, .dynsym, .comment. (_bfd_ecoff_styp_to_sec_flags): Check for various Alpha section types. (ecoff_sort_hdrs): New static function. (ecoff_compute_section_file_positions): Return boolean, not void. Sort the sections by VMA before looking through them. Put the first non SEC_ALLOC section on a new page. Put every SEC_ALLOC section on an appropriate boundary within the page. (ecoff_compute_reloc_file_positions): Check return value of ecoff_compute_section_file_positions. (_bfd_ecoff_set_section_contents): Likewise. (_bfd_ecoff_write_object_contents): Check for various Alpha section types when incrementing text_size and data_size. Call adjust_headers backend function if it exists. * coff-alpha.c (alpha_adjust_headers): New static function. (alpha_ecoff_backend_data): Initialize adjust_headers field. * coff-mips.c (mips_ecoff_backend_data): Likewise. PR 8141.
Diffstat (limited to 'bfd/coff-alpha.c')
-rw-r--r--bfd/coff-alpha.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index 8d0b3a5..d914d4d 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -55,6 +55,8 @@ static bfd_vma alpha_convert_external_reloc
static boolean alpha_relocate_section PARAMS ((bfd *, struct bfd_link_info *,
bfd *, asection *,
bfd_byte *, PTR));
+static boolean alpha_adjust_headers
+ PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *));
/* ECOFF has COFF sections, but the debugging information is stored in
a completely different format. ECOFF targets use some of the
@@ -1935,6 +1937,23 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section,
return true;
}
+/* Do final adjustments to the filehdr and the aouthdr. This routine
+ sets the dynamic bits in the file header. */
+
+/*ARGSUSED*/
+static boolean
+alpha_adjust_headers (abfd, fhdr, ahdr)
+ bfd *abfd;
+ struct internal_filehdr *fhdr;
+ struct internal_aouthdr *ahdr;
+{
+ if ((abfd->flags & (DYNAMIC | EXEC_P)) == (DYNAMIC | EXEC_P))
+ fhdr->f_flags |= F_ALPHA_CALL_SHARED;
+ else if ((abfd->flags & DYNAMIC) != 0)
+ fhdr->f_flags |= F_ALPHA_SHARABLE;
+ return true;
+}
+
/* This is the ECOFF backend structure. The backend field of the
target vector points to this. */
@@ -1956,8 +1975,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
alpha_ecoff_swap_scnhdr_in, NULL,
alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
alpha_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
- _bfd_ecoff_make_section_hook, _bfd_ecoff_set_alignment_hook,
- _bfd_ecoff_slurp_symbol_table,
+ _bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
NULL, NULL, NULL, NULL, NULL, NULL, NULL
},
/* Supported architecture. */
@@ -2023,7 +2041,9 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
alpha_adjust_reloc_in,
alpha_adjust_reloc_out,
/* Relocate section contents while linking. */
- alpha_relocate_section
+ alpha_relocate_section,
+ /* Do final adjustments to filehdr and aouthdr. */
+ alpha_adjust_headers
};
/* Looking up a reloc type is Alpha specific. */