* elf-bfd.h (elf_backend_data::elf_backend_modify_segment_map):

Add link info argument.
* elf32-i370.c (elf_backend_modify_segment_map): Likewise.
* elf32-ppc.c (ppc_elf_modify_segment_map): Likewise.
* elf32-xtensa.c (elf_xtensa_modify_segment_map): Likewise.
* elf64-hppa.c (elf64_hppa_modify_segment_map): Likewise.
* elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise.
* elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise.
* elfxx-mips.h (_bfd_mips_elf_modify_segment_map): Likewise.
* elf.c (assign_file_positions_except_relocs,
assign_file_positions_for_segments): Likewise.  Adjust calls.
This commit is contained in:
Alexandre Oliva
2003-11-27 16:43:25 +00:00
parent 13739f4d37
commit c84fca4d18
10 changed files with 37 additions and 17 deletions

@ -1,3 +1,17 @@
2003-11-27 Alexandre Oliva <aoliva@redhat.com>
* elf-bfd.h (elf_backend_data::elf_backend_modify_segment_map):
Add link info argument.
* elf32-i370.c (elf_backend_modify_segment_map): Likewise.
* elf32-ppc.c (ppc_elf_modify_segment_map): Likewise.
* elf32-xtensa.c (elf_xtensa_modify_segment_map): Likewise.
* elf64-hppa.c (elf64_hppa_modify_segment_map): Likewise.
* elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise.
* elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise.
* elfxx-mips.h (_bfd_mips_elf_modify_segment_map): Likewise.
* elf.c (assign_file_positions_except_relocs,
assign_file_positions_for_segments): Likewise. Adjust calls.
2003-11-27 Mark Kettenis <kettenis@gnu.org> 2003-11-27 Mark Kettenis <kettenis@gnu.org>
* elf.c (elfcore_grok_netbsd_procinfo): Make a pseudosection out * elf.c (elfcore_grok_netbsd_procinfo): Make a pseudosection out

@ -760,7 +760,7 @@ struct elf_backend_data
/* This function is called to modify an existing segment map in a /* This function is called to modify an existing segment map in a
backend specific fashion. */ backend specific fashion. */
bfd_boolean (*elf_backend_modify_segment_map) bfd_boolean (*elf_backend_modify_segment_map)
(bfd *); (bfd *, struct bfd_link_info *);
/* This function is called during section gc to discover the section a /* This function is called during section gc to discover the section a
particular relocation refers to. */ particular relocation refers to. */

@ -41,7 +41,7 @@
#include "libiberty.h" #include "libiberty.h"
static int elf_sort_sections (const void *, const void *); static int elf_sort_sections (const void *, const void *);
static bfd_boolean assign_file_positions_except_relocs (bfd *); static bfd_boolean assign_file_positions_except_relocs (bfd *, struct bfd_link_info *);
static bfd_boolean prep_headers (bfd *); static bfd_boolean prep_headers (bfd *);
static bfd_boolean swap_out_syms (bfd *, struct bfd_strtab_hash **, int) ; static bfd_boolean swap_out_syms (bfd *, struct bfd_strtab_hash **, int) ;
static bfd_boolean elfcore_read_notes (bfd *, file_ptr, bfd_size_type) ; static bfd_boolean elfcore_read_notes (bfd *, file_ptr, bfd_size_type) ;
@ -3103,7 +3103,7 @@ _bfd_elf_compute_section_file_positions (bfd *abfd,
/* sh_offset is set in assign_file_positions_except_relocs. */ /* sh_offset is set in assign_file_positions_except_relocs. */
shstrtab_hdr->sh_addralign = 1; shstrtab_hdr->sh_addralign = 1;
if (!assign_file_positions_except_relocs (abfd)) if (!assign_file_positions_except_relocs (abfd, link_info))
return FALSE; return FALSE;
if (link_info == NULL && bfd_get_symcount (abfd) > 0) if (link_info == NULL && bfd_get_symcount (abfd) > 0)
@ -3576,7 +3576,7 @@ elf_sort_sections (const void *arg1, const void *arg2)
the file header, and writes out the program headers. */ the file header, and writes out the program headers. */
static bfd_boolean static bfd_boolean
assign_file_positions_for_segments (bfd *abfd) assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info)
{ {
const struct elf_backend_data *bed = get_elf_backend_data (abfd); const struct elf_backend_data *bed = get_elf_backend_data (abfd);
unsigned int count; unsigned int count;
@ -3628,7 +3628,7 @@ assign_file_positions_for_segments (bfd *abfd)
if (bed->elf_backend_modify_segment_map) if (bed->elf_backend_modify_segment_map)
{ {
if (! (*bed->elf_backend_modify_segment_map) (abfd)) if (! (*bed->elf_backend_modify_segment_map) (abfd, link_info))
return FALSE; return FALSE;
} }
@ -4136,7 +4136,8 @@ get_program_header_size (bfd *abfd)
We also don't set the positions of the .symtab and .strtab here. */ We also don't set the positions of the .symtab and .strtab here. */
static bfd_boolean static bfd_boolean
assign_file_positions_except_relocs (bfd *abfd) assign_file_positions_except_relocs (bfd *abfd,
struct bfd_link_info *link_info)
{ {
struct elf_obj_tdata * const tdata = elf_tdata (abfd); struct elf_obj_tdata * const tdata = elf_tdata (abfd);
Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd); Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd);
@ -4187,7 +4188,7 @@ assign_file_positions_except_relocs (bfd *abfd)
/* Assign file positions for the loaded sections based on the /* Assign file positions for the loaded sections based on the
assignment of sections to segments. */ assignment of sections to segments. */
if (! assign_file_positions_for_segments (abfd)) if (! assign_file_positions_for_segments (abfd, link_info))
return FALSE; return FALSE;
/* Assign file positions for the other sections. */ /* Assign file positions for the other sections. */

@ -1555,6 +1555,6 @@ static int i370_noop ()
#define elf_backend_additional_program_headers \ #define elf_backend_additional_program_headers \
(int (*) PARAMS ((bfd *))) i370_noop (int (*) PARAMS ((bfd *))) i370_noop
#define elf_backend_modify_segment_map \ #define elf_backend_modify_segment_map \
(bfd_boolean (*) PARAMS ((bfd *))) i370_noop (bfd_boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) i370_noop
#include "elf32-target.h" #include "elf32-target.h"

@ -2739,7 +2739,8 @@ ppc_elf_additional_program_headers (bfd *abfd)
/* Modify the segment map if needed. */ /* Modify the segment map if needed. */
static bfd_boolean static bfd_boolean
ppc_elf_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED) ppc_elf_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info ATTRIBUTE_UNUSED)
{ {
return TRUE; return TRUE;
} }

@ -60,7 +60,7 @@ static bfd_boolean elf_xtensa_adjust_dynamic_symbol
static bfd_boolean elf_xtensa_size_dynamic_sections static bfd_boolean elf_xtensa_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elf_xtensa_modify_segment_map static bfd_boolean elf_xtensa_modify_segment_map
PARAMS ((bfd *)); PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elf_xtensa_relocate_section static bfd_boolean elf_xtensa_relocate_section
PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
@ -1415,8 +1415,9 @@ elf_xtensa_size_dynamic_sections (output_bfd, info)
this and it probably ought to be moved into elf.c as well. */ this and it probably ought to be moved into elf.c as well. */
static bfd_boolean static bfd_boolean
elf_xtensa_modify_segment_map (abfd) elf_xtensa_modify_segment_map (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED;
{ {
struct elf_segment_map **m_p; struct elf_segment_map **m_p;

@ -213,7 +213,7 @@ static int elf64_hppa_additional_program_headers
PARAMS ((bfd *)); PARAMS ((bfd *));
static bfd_boolean elf64_hppa_modify_segment_map static bfd_boolean elf64_hppa_modify_segment_map
PARAMS ((bfd *)); PARAMS ((bfd *, struct bfd_link_info *));
static enum elf_reloc_type_class elf64_hppa_reloc_type_class static enum elf_reloc_type_class elf64_hppa_reloc_type_class
PARAMS ((const Elf_Internal_Rela *)); PARAMS ((const Elf_Internal_Rela *));
@ -2609,8 +2609,9 @@ elf64_hppa_additional_program_headers (abfd)
existence of a .interp section. */ existence of a .interp section. */
static bfd_boolean static bfd_boolean
elf64_hppa_modify_segment_map (abfd) elf64_hppa_modify_segment_map (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED;
{ {
struct elf_segment_map *m; struct elf_segment_map *m;
asection *s; asection *s;

@ -194,7 +194,7 @@ static bfd_boolean elfNN_ia64_add_symbol_hook
static int elfNN_ia64_additional_program_headers static int elfNN_ia64_additional_program_headers
PARAMS ((bfd *abfd)); PARAMS ((bfd *abfd));
static bfd_boolean elfNN_ia64_modify_segment_map static bfd_boolean elfNN_ia64_modify_segment_map
PARAMS ((bfd *)); PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elfNN_ia64_is_local_label_name static bfd_boolean elfNN_ia64_is_local_label_name
PARAMS ((bfd *abfd, const char *name)); PARAMS ((bfd *abfd, const char *name));
static bfd_boolean elfNN_ia64_dynamic_symbol_p static bfd_boolean elfNN_ia64_dynamic_symbol_p
@ -1405,8 +1405,9 @@ elfNN_ia64_additional_program_headers (abfd)
} }
static bfd_boolean static bfd_boolean
elfNN_ia64_modify_segment_map (abfd) elfNN_ia64_modify_segment_map (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED;
{ {
struct elf_segment_map *m, **pm; struct elf_segment_map *m, **pm;
Elf_Internal_Shdr *hdr; Elf_Internal_Shdr *hdr;

@ -7308,8 +7308,9 @@ _bfd_mips_elf_additional_program_headers (abfd)
/* Modify the segment map for an IRIX5 executable. */ /* Modify the segment map for an IRIX5 executable. */
bfd_boolean bfd_boolean
_bfd_mips_elf_modify_segment_map (abfd) _bfd_mips_elf_modify_segment_map (abfd, info)
bfd *abfd; bfd *abfd;
struct bfd_link_info *info ATTRIBUTE_UNUSED;
{ {
asection *s; asection *s;
struct elf_segment_map *m, **pm; struct elf_segment_map *m, **pm;

@ -62,7 +62,7 @@ extern void _bfd_mips_elf_final_write_processing
extern int _bfd_mips_elf_additional_program_headers extern int _bfd_mips_elf_additional_program_headers
PARAMS ((bfd *)); PARAMS ((bfd *));
extern bfd_boolean _bfd_mips_elf_modify_segment_map extern bfd_boolean _bfd_mips_elf_modify_segment_map
PARAMS ((bfd *)); PARAMS ((bfd *, struct bfd_link_info *));
extern asection * _bfd_mips_elf_gc_mark_hook extern asection * _bfd_mips_elf_gc_mark_hook
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *)); struct elf_link_hash_entry *, Elf_Internal_Sym *));