2001-01-03 Kazu Hirata <kazu@hxi.com>
* ecoffswap.h: Fix formatting. * elf-bfd.h: Likewise. * elfarm-nabi.c: Likewise. * elfarm-oabi.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elflink.h: Likewise. * elfxx-ia64.c: Likewise. * elfxx-target.h: Likewise.
This commit is contained in:
parent
ad2a4d0953
commit
3e932841da
@ -1,6 +1,16 @@
|
|||||||
2001-01-03 Kazu Hirata <kazu@hxi.com>
|
2001-01-03 Kazu Hirata <kazu@hxi.com>
|
||||||
|
|
||||||
* libbfd.c: Fix formatting.
|
* ecoffswap.h: Fix formatting.
|
||||||
|
* elf-bfd.h: Likewise.
|
||||||
|
* elfarm-nabi.c: Likewise.
|
||||||
|
* elfarm-oabi.c: Likewise.
|
||||||
|
* elfcode.h: Likewise.
|
||||||
|
* elfcore.h: Likewise.
|
||||||
|
* elflink.c: Likewise.
|
||||||
|
* elflink.h: Likewise.
|
||||||
|
* elfxx-ia64.c: Likewise.
|
||||||
|
* elfxx-target.h: Likewise.
|
||||||
|
* libbfd.c: Likewise
|
||||||
* linker.c: Likewise.
|
* linker.c: Likewise.
|
||||||
* lynx-core.c: Likewise.
|
* lynx-core.c: Likewise.
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ ecoff_swap_hdr_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ ecoff_swap_hdr_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern)
|
|||||||
intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase);
|
intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase);
|
||||||
intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd);
|
intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd);
|
||||||
|
|
||||||
/* now the fun stuff... */
|
/* now the fun stuff... */
|
||||||
if (bfd_header_big_endian (abfd)) {
|
if (bfd_header_big_endian (abfd)) {
|
||||||
intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_BIG)
|
intern->lang = (ext->f_bits1[0] & FDR_BITS1_LANG_BIG)
|
||||||
>> FDR_BITS1_LANG_SH_BIG;
|
>> FDR_BITS1_LANG_SH_BIG;
|
||||||
@ -244,7 +244,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr)
|
|||||||
bfd_h_put_32 (abfd, intern->rfdBase, (bfd_byte *)ext->f_rfdBase);
|
bfd_h_put_32 (abfd, intern->rfdBase, (bfd_byte *)ext->f_rfdBase);
|
||||||
bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->f_crfd);
|
bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->f_crfd);
|
||||||
|
|
||||||
/* now the fun stuff... */
|
/* now the fun stuff... */
|
||||||
if (bfd_header_big_endian (abfd)) {
|
if (bfd_header_big_endian (abfd)) {
|
||||||
ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG)
|
ext->f_bits1[0] = (((intern->lang << FDR_BITS1_LANG_SH_BIG)
|
||||||
& FDR_BITS1_LANG_BIG)
|
& FDR_BITS1_LANG_BIG)
|
||||||
@ -312,7 +312,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +377,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,13 +438,13 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* MPW_C */
|
#else /* MPW_C */
|
||||||
/* Same routines, but with ECOFF_64 code removed, so ^&%$#&! MPW C doesn't
|
/* Same routines, but with ECOFF_64 code removed, so ^&%$#&! MPW C doesn't
|
||||||
corrupt itself and then freak out. */
|
corrupt itself and then freak out. */
|
||||||
/* Swap in the procedure descriptor record. */
|
/* Swap in the procedure descriptor record. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -477,7 +477,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -511,7 +511,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* MPW_C */
|
#endif /* MPW_C */
|
||||||
@ -531,7 +531,7 @@ ecoff_swap_sym_in (abfd, ext_copy, intern)
|
|||||||
intern->iss = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_iss);
|
intern->iss = bfd_h_get_32 (abfd, (bfd_byte *)ext->s_iss);
|
||||||
intern->value = ecoff_get_off (abfd, (bfd_byte *)ext->s_value);
|
intern->value = ecoff_get_off (abfd, (bfd_byte *)ext->s_value);
|
||||||
|
|
||||||
/* now the fun stuff... */
|
/* now the fun stuff... */
|
||||||
if (bfd_header_big_endian (abfd)) {
|
if (bfd_header_big_endian (abfd)) {
|
||||||
intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG)
|
intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG)
|
||||||
>> SYM_BITS1_ST_SH_BIG;
|
>> SYM_BITS1_ST_SH_BIG;
|
||||||
@ -561,7 +561,7 @@ ecoff_swap_sym_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,7 +581,7 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr)
|
|||||||
bfd_h_put_32 (abfd, intern->iss, (bfd_byte *)ext->s_iss);
|
bfd_h_put_32 (abfd, intern->iss, (bfd_byte *)ext->s_iss);
|
||||||
ecoff_put_off (abfd, intern->value, (bfd_byte *)ext->s_value);
|
ecoff_put_off (abfd, intern->value, (bfd_byte *)ext->s_value);
|
||||||
|
|
||||||
/* now the fun stuff... */
|
/* now the fun stuff... */
|
||||||
if (bfd_header_big_endian (abfd)) {
|
if (bfd_header_big_endian (abfd)) {
|
||||||
ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_BIG)
|
ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_BIG)
|
||||||
& SYM_BITS1_ST_BIG)
|
& SYM_BITS1_ST_BIG)
|
||||||
@ -610,7 +610,7 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ ecoff_swap_ext_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
*ext = *(struct ext_ext *) ext_copy;
|
*ext = *(struct ext_ext *) ext_copy;
|
||||||
|
|
||||||
/* now the fun stuff... */
|
/* now the fun stuff... */
|
||||||
if (bfd_header_big_endian (abfd)) {
|
if (bfd_header_big_endian (abfd)) {
|
||||||
intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_BIG);
|
intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_BIG);
|
||||||
intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_BIG);
|
intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_BIG);
|
||||||
@ -649,7 +649,7 @@ ecoff_swap_ext_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,7 +666,7 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
*intern = *intern_copy; /* Make it reasonable to do in-place. */
|
*intern = *intern_copy; /* Make it reasonable to do in-place. */
|
||||||
|
|
||||||
/* now the fun stuff... */
|
/* now the fun stuff... */
|
||||||
if (bfd_header_big_endian (abfd)) {
|
if (bfd_header_big_endian (abfd)) {
|
||||||
ext->es_bits1[0] = ((intern->jmptbl ? EXT_BITS1_JMPTBL_BIG : 0)
|
ext->es_bits1[0] = ((intern->jmptbl ? EXT_BITS1_JMPTBL_BIG : 0)
|
||||||
| (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_BIG : 0)
|
| (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_BIG : 0)
|
||||||
@ -698,7 +698,7 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,7 +716,7 @@ ecoff_swap_rfd_in (abfd, ext_ptr, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -734,7 +734,7 @@ ecoff_swap_rfd_out (abfd, intern, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -775,7 +775,7 @@ ecoff_swap_opt_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -814,7 +814,7 @@ ecoff_swap_opt_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,7 +835,7 @@ ecoff_swap_dnr_in (abfd, ext_copy, intern)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -857,6 +857,6 @@ ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr)
|
|||||||
|
|
||||||
#ifdef TEST
|
#ifdef TEST
|
||||||
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
|
||||||
abort();
|
abort ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ struct elf_backend_data
|
|||||||
unsigned int));
|
unsigned int));
|
||||||
|
|
||||||
/* A function to set the type of the info field. Processor-specific
|
/* A function to set the type of the info field. Processor-specific
|
||||||
types should be handled here. */
|
types should be handled here. */
|
||||||
int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int));
|
int (*elf_backend_get_symbol_type) PARAMS (( Elf_Internal_Sym *, int));
|
||||||
|
|
||||||
/* A function to do additional processing on the ELF section header
|
/* A function to do additional processing on the ELF section header
|
||||||
@ -397,7 +397,7 @@ struct elf_backend_data
|
|||||||
Elf32_Internal_Shdr *));
|
Elf32_Internal_Shdr *));
|
||||||
|
|
||||||
/* A function to handle unusual program segment types when creating BFD
|
/* A function to handle unusual program segment types when creating BFD
|
||||||
sections from ELF program segments. */
|
sections from ELF program segments. */
|
||||||
boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *,
|
boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *,
|
||||||
Elf32_Internal_Phdr *,
|
Elf32_Internal_Phdr *,
|
||||||
int));
|
int));
|
||||||
@ -796,14 +796,14 @@ struct elf_obj_tdata
|
|||||||
file_ptr next_file_pos;
|
file_ptr next_file_pos;
|
||||||
#if 0
|
#if 0
|
||||||
/* we don't need these inside bfd anymore, and I think
|
/* we don't need these inside bfd anymore, and I think
|
||||||
these weren't used outside bfd. */
|
these weren't used outside bfd. */
|
||||||
void *prstatus; /* The raw /proc prstatus structure */
|
void *prstatus; /* The raw /proc prstatus structure */
|
||||||
void *prpsinfo; /* The raw /proc prpsinfo structure */
|
void *prpsinfo; /* The raw /proc prpsinfo structure */
|
||||||
#endif
|
#endif
|
||||||
bfd_vma gp; /* The gp value (MIPS only, for now) */
|
bfd_vma gp; /* The gp value (MIPS only, for now) */
|
||||||
unsigned int gp_size; /* The gp size (MIPS only, for now) */
|
unsigned int gp_size; /* The gp size (MIPS only, for now) */
|
||||||
|
|
||||||
/* Information grabbed from an elf core file. */
|
/* Information grabbed from an elf core file. */
|
||||||
int core_signal;
|
int core_signal;
|
||||||
int core_pid;
|
int core_pid;
|
||||||
int core_lwpid;
|
int core_lwpid;
|
||||||
@ -825,7 +825,7 @@ struct elf_obj_tdata
|
|||||||
document the intent of any particular piece of code. The field
|
document the intent of any particular piece of code. The field
|
||||||
should be used as a count until size_dynamic_sections, at which
|
should be used as a count until size_dynamic_sections, at which
|
||||||
point the contents of the .got is fixed. Afterward, if an entry
|
point the contents of the .got is fixed. Afterward, if an entry
|
||||||
is -1, then the symbol does not require a global offset table entry. */
|
is -1, then the symbol does not require a global offset table entry. */
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
bfd_signed_vma *refcounts;
|
bfd_signed_vma *refcounts;
|
||||||
@ -851,7 +851,7 @@ struct elf_obj_tdata
|
|||||||
ELF emulation code, we need to add the shared object to the
|
ELF emulation code, we need to add the shared object to the
|
||||||
DT_NEEDED list of the resulting binary to indicate the dependency
|
DT_NEEDED list of the resulting binary to indicate the dependency
|
||||||
as if the -l option is passed to the linker. This field holds the
|
as if the -l option is passed to the linker. This field holds the
|
||||||
name of the loaded shared object. */
|
name of the loaded shared object. */
|
||||||
const char *dt_soname;
|
const char *dt_soname;
|
||||||
|
|
||||||
/* Irix 5 often screws up the symbol table, sorting local symbols
|
/* Irix 5 often screws up the symbol table, sorting local symbols
|
||||||
@ -873,10 +873,10 @@ struct elf_obj_tdata
|
|||||||
find_nearest_line. */
|
find_nearest_line. */
|
||||||
struct mips_elf_find_line *find_line_info;
|
struct mips_elf_find_line *find_line_info;
|
||||||
|
|
||||||
/* A place to stash dwarf1 info for this bfd. */
|
/* A place to stash dwarf1 info for this bfd. */
|
||||||
struct dwarf1_debug *dwarf1_find_line_info;
|
struct dwarf1_debug *dwarf1_find_line_info;
|
||||||
|
|
||||||
/* A place to stash dwarf2 info for this bfd. */
|
/* A place to stash dwarf2 info for this bfd. */
|
||||||
PTR dwarf2_find_line_info;
|
PTR dwarf2_find_line_info;
|
||||||
|
|
||||||
/* An array of stub sections indexed by symbol number, used by the
|
/* An array of stub sections indexed by symbol number, used by the
|
||||||
|
@ -45,7 +45,7 @@ static reloc_howto_type * elf32_arm_reloc_type_lookup
|
|||||||
|
|
||||||
/* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
|
/* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
|
||||||
R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO
|
R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO
|
||||||
in that slot. */
|
in that slot. */
|
||||||
|
|
||||||
static reloc_howto_type elf32_arm_howto_table[] =
|
static reloc_howto_type elf32_arm_howto_table[] =
|
||||||
{
|
{
|
||||||
@ -578,7 +578,6 @@ static reloc_howto_type elf32_arm_thm_pc9_howto =
|
|||||||
0x000000ff, /* dst_mask */
|
0x000000ff, /* dst_mask */
|
||||||
true); /* pcrel_offset */
|
true); /* pcrel_offset */
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
|
elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc)
|
||||||
bfd * abfd ATTRIBUTE_UNUSED;
|
bfd * abfd ATTRIBUTE_UNUSED;
|
||||||
|
@ -197,7 +197,7 @@ static char *elf_symbol_flags PARAMS ((flagword));
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Translate an ELF symbol in external format into an ELF symbol in internal
|
/* Translate an ELF symbol in external format into an ELF symbol in internal
|
||||||
format. */
|
format. */
|
||||||
|
|
||||||
void
|
void
|
||||||
elf_swap_symbol_in (abfd, src, dst)
|
elf_swap_symbol_in (abfd, src, dst)
|
||||||
@ -219,7 +219,7 @@ elf_swap_symbol_in (abfd, src, dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Translate an ELF symbol in internal format into an ELF symbol in external
|
/* Translate an ELF symbol in internal format into an ELF symbol in external
|
||||||
format. */
|
format. */
|
||||||
|
|
||||||
void
|
void
|
||||||
elf_swap_symbol_out (abfd, src, cdst)
|
elf_swap_symbol_out (abfd, src, cdst)
|
||||||
@ -236,9 +236,8 @@ elf_swap_symbol_out (abfd, src, cdst)
|
|||||||
bfd_h_put_16 (abfd, src->st_shndx, dst->st_shndx);
|
bfd_h_put_16 (abfd, src->st_shndx, dst->st_shndx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Translate an ELF file header in external format into an ELF file header in
|
/* Translate an ELF file header in external format into an ELF file header in
|
||||||
internal format. */
|
internal format. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elf_swap_ehdr_in (abfd, src, dst)
|
elf_swap_ehdr_in (abfd, src, dst)
|
||||||
@ -267,7 +266,7 @@ elf_swap_ehdr_in (abfd, src, dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Translate an ELF file header in internal format into an ELF file header in
|
/* Translate an ELF file header in internal format into an ELF file header in
|
||||||
external format. */
|
external format. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elf_swap_ehdr_out (abfd, src, dst)
|
elf_swap_ehdr_out (abfd, src, dst)
|
||||||
@ -277,7 +276,7 @@ elf_swap_ehdr_out (abfd, src, dst)
|
|||||||
{
|
{
|
||||||
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
|
int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma;
|
||||||
memcpy (dst->e_ident, src->e_ident, EI_NIDENT);
|
memcpy (dst->e_ident, src->e_ident, EI_NIDENT);
|
||||||
/* note that all elements of dst are *arrays of unsigned char* already... */
|
/* note that all elements of dst are *arrays of unsigned char* already... */
|
||||||
bfd_h_put_16 (abfd, src->e_type, dst->e_type);
|
bfd_h_put_16 (abfd, src->e_type, dst->e_type);
|
||||||
bfd_h_put_16 (abfd, src->e_machine, dst->e_machine);
|
bfd_h_put_16 (abfd, src->e_machine, dst->e_machine);
|
||||||
bfd_h_put_32 (abfd, src->e_version, dst->e_version);
|
bfd_h_put_32 (abfd, src->e_version, dst->e_version);
|
||||||
@ -296,9 +295,8 @@ elf_swap_ehdr_out (abfd, src, dst)
|
|||||||
bfd_h_put_16 (abfd, src->e_shstrndx, dst->e_shstrndx);
|
bfd_h_put_16 (abfd, src->e_shstrndx, dst->e_shstrndx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Translate an ELF section header table entry in external format into an
|
/* Translate an ELF section header table entry in external format into an
|
||||||
ELF section header table entry in internal format. */
|
ELF section header table entry in internal format. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elf_swap_shdr_in (abfd, src, dst)
|
elf_swap_shdr_in (abfd, src, dst)
|
||||||
@ -326,7 +324,7 @@ elf_swap_shdr_in (abfd, src, dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Translate an ELF section header table entry in internal format into an
|
/* Translate an ELF section header table entry in internal format into an
|
||||||
ELF section header table entry in external format. */
|
ELF section header table entry in external format. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
elf_swap_shdr_out (abfd, src, dst)
|
elf_swap_shdr_out (abfd, src, dst)
|
||||||
@ -334,7 +332,7 @@ elf_swap_shdr_out (abfd, src, dst)
|
|||||||
const Elf_Internal_Shdr *src;
|
const Elf_Internal_Shdr *src;
|
||||||
Elf_External_Shdr *dst;
|
Elf_External_Shdr *dst;
|
||||||
{
|
{
|
||||||
/* note that all elements of dst are *arrays of unsigned char* already... */
|
/* note that all elements of dst are *arrays of unsigned char* already... */
|
||||||
bfd_h_put_32 (abfd, src->sh_name, dst->sh_name);
|
bfd_h_put_32 (abfd, src->sh_name, dst->sh_name);
|
||||||
bfd_h_put_32 (abfd, src->sh_type, dst->sh_type);
|
bfd_h_put_32 (abfd, src->sh_type, dst->sh_type);
|
||||||
put_word (abfd, src->sh_flags, dst->sh_flags);
|
put_word (abfd, src->sh_flags, dst->sh_flags);
|
||||||
@ -347,9 +345,8 @@ elf_swap_shdr_out (abfd, src, dst)
|
|||||||
put_word (abfd, src->sh_entsize, dst->sh_entsize);
|
put_word (abfd, src->sh_entsize, dst->sh_entsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Translate an ELF program header table entry in external format into an
|
/* Translate an ELF program header table entry in external format into an
|
||||||
ELF program header table entry in internal format. */
|
ELF program header table entry in internal format. */
|
||||||
|
|
||||||
void
|
void
|
||||||
elf_swap_phdr_in (abfd, src, dst)
|
elf_swap_phdr_in (abfd, src, dst)
|
||||||
@ -383,7 +380,7 @@ elf_swap_phdr_out (abfd, src, dst)
|
|||||||
const Elf_Internal_Phdr *src;
|
const Elf_Internal_Phdr *src;
|
||||||
Elf_External_Phdr *dst;
|
Elf_External_Phdr *dst;
|
||||||
{
|
{
|
||||||
/* note that all elements of dst are *arrays of unsigned char* already... */
|
/* note that all elements of dst are *arrays of unsigned char* already... */
|
||||||
bfd_h_put_32 (abfd, src->p_type, dst->p_type);
|
bfd_h_put_32 (abfd, src->p_type, dst->p_type);
|
||||||
put_word (abfd, src->p_offset, dst->p_offset);
|
put_word (abfd, src->p_offset, dst->p_offset);
|
||||||
put_word (abfd, src->p_vaddr, dst->p_vaddr);
|
put_word (abfd, src->p_vaddr, dst->p_vaddr);
|
||||||
@ -394,7 +391,7 @@ elf_swap_phdr_out (abfd, src, dst)
|
|||||||
put_word (abfd, src->p_align, dst->p_align);
|
put_word (abfd, src->p_align, dst->p_align);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Translate an ELF reloc from external format to internal format. */
|
/* Translate an ELF reloc from external format to internal format. */
|
||||||
INLINE void
|
INLINE void
|
||||||
elf_swap_reloc_in (abfd, src, dst)
|
elf_swap_reloc_in (abfd, src, dst)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -416,7 +413,7 @@ elf_swap_reloca_in (abfd, src, dst)
|
|||||||
dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend);
|
dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Translate an ELF reloc from internal format to external format. */
|
/* Translate an ELF reloc from internal format to external format. */
|
||||||
INLINE void
|
INLINE void
|
||||||
elf_swap_reloc_out (abfd, src, dst)
|
elf_swap_reloc_out (abfd, src, dst)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -464,7 +461,6 @@ elf_swap_dyn_out (abfd, src, p)
|
|||||||
|
|
||||||
/* ELF .o/exec file reading */
|
/* ELF .o/exec file reading */
|
||||||
|
|
||||||
|
|
||||||
/* Begin processing a given object.
|
/* Begin processing a given object.
|
||||||
|
|
||||||
First we validate the file by reading in the ELF header and checking
|
First we validate the file by reading in the ELF header and checking
|
||||||
@ -526,7 +522,7 @@ elf_object_p (abfd)
|
|||||||
make use of. The magic number must match, the address size ('class')
|
make use of. The magic number must match, the address size ('class')
|
||||||
and byte-swapping must match our XVEC entry, and it must have a
|
and byte-swapping must match our XVEC entry, and it must have a
|
||||||
section header table (FIXME: See comments re sections at top of this
|
section header table (FIXME: See comments re sections at top of this
|
||||||
file). */
|
file). */
|
||||||
|
|
||||||
if ((elf_file_p (&x_ehdr) == false) ||
|
if ((elf_file_p (&x_ehdr) == false) ||
|
||||||
(x_ehdr.e_ident[EI_VERSION] != EV_CURRENT) ||
|
(x_ehdr.e_ident[EI_VERSION] != EV_CURRENT) ||
|
||||||
@ -569,13 +565,13 @@ elf_object_p (abfd)
|
|||||||
if (i_ehdrp->e_type == ET_CORE)
|
if (i_ehdrp->e_type == ET_CORE)
|
||||||
goto got_wrong_format_error;
|
goto got_wrong_format_error;
|
||||||
|
|
||||||
/* If there is no section header table, we're hosed. */
|
/* If there is no section header table, we're hosed. */
|
||||||
if (i_ehdrp->e_shoff == 0)
|
if (i_ehdrp->e_shoff == 0)
|
||||||
goto got_wrong_format_error;
|
goto got_wrong_format_error;
|
||||||
|
|
||||||
/* As a simple sanity check, verify that the what BFD thinks is the
|
/* As a simple sanity check, verify that the what BFD thinks is the
|
||||||
size of each section header table entry actually matches the size
|
size of each section header table entry actually matches the size
|
||||||
recorded in the file. */
|
recorded in the file. */
|
||||||
if (i_ehdrp->e_shentsize != sizeof (x_shdr))
|
if (i_ehdrp->e_shentsize != sizeof (x_shdr))
|
||||||
goto got_wrong_format_error;
|
goto got_wrong_format_error;
|
||||||
|
|
||||||
@ -629,7 +625,7 @@ elf_object_p (abfd)
|
|||||||
goto got_no_match;
|
goto got_no_match;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remember the entry point specified in the ELF file header. */
|
/* Remember the entry point specified in the ELF file header. */
|
||||||
bfd_set_start_address (abfd, i_ehdrp->e_entry);
|
bfd_set_start_address (abfd, i_ehdrp->e_entry);
|
||||||
|
|
||||||
/* Allocate space for a copy of the section header table in
|
/* Allocate space for a copy of the section header table in
|
||||||
@ -695,7 +691,7 @@ elf_object_p (abfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read in the string table containing the names of the sections. We
|
/* Read in the string table containing the names of the sections. We
|
||||||
will need the base pointer to this table later. */
|
will need the base pointer to this table later. */
|
||||||
/* We read this inline now, so that we don't have to go through
|
/* We read this inline now, so that we don't have to go through
|
||||||
bfd_section_from_shdr with it (since this particular strtab is
|
bfd_section_from_shdr with it (since this particular strtab is
|
||||||
used to find all of the ELF section names.) */
|
used to find all of the ELF section names.) */
|
||||||
@ -822,7 +818,7 @@ elf_write_relocs (abfd, sec, data)
|
|||||||
SHT_REL section. */
|
SHT_REL section. */
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
/* orelocation has the data, reloc_count has the count... */
|
/* orelocation has the data, reloc_count has the count... */
|
||||||
if (use_rela_p)
|
if (use_rela_p)
|
||||||
{
|
{
|
||||||
outbound_relocas = (Elf_External_Rela *) rela_hdr->contents;
|
outbound_relocas = (Elf_External_Rela *) rela_hdr->contents;
|
||||||
@ -968,7 +964,7 @@ elf_write_shdrs_and_ehdr (abfd)
|
|||||||
i_ehdrp = elf_elfheader (abfd);
|
i_ehdrp = elf_elfheader (abfd);
|
||||||
i_shdrp = elf_elfsections (abfd);
|
i_shdrp = elf_elfsections (abfd);
|
||||||
|
|
||||||
/* swap the header before spitting it out... */
|
/* swap the header before spitting it out... */
|
||||||
|
|
||||||
#if DEBUG & 1
|
#if DEBUG & 1
|
||||||
elf_debug_file (i_ehdrp);
|
elf_debug_file (i_ehdrp);
|
||||||
@ -979,7 +975,7 @@ elf_write_shdrs_and_ehdr (abfd)
|
|||||||
!= sizeof (x_ehdr)))
|
!= sizeof (x_ehdr)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* at this point we've concocted all the ELF sections... */
|
/* at this point we've concocted all the ELF sections... */
|
||||||
x_shdrp = (Elf_External_Shdr *)
|
x_shdrp = (Elf_External_Shdr *)
|
||||||
bfd_alloc (abfd, sizeof (*x_shdrp) * (i_ehdrp->e_shnum));
|
bfd_alloc (abfd, sizeof (*x_shdrp) * (i_ehdrp->e_shnum));
|
||||||
if (!x_shdrp)
|
if (!x_shdrp)
|
||||||
@ -997,7 +993,7 @@ elf_write_shdrs_and_ehdr (abfd)
|
|||||||
!= sizeof (*x_shdrp) * i_ehdrp->e_shnum))
|
!= sizeof (*x_shdrp) * i_ehdrp->e_shnum))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* need to dump the string table too... */
|
/* need to dump the string table too... */
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1025,7 +1021,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
|||||||
based on a one-to-one mapping of the ELF symbols to canonical
|
based on a one-to-one mapping of the ELF symbols to canonical
|
||||||
symbols. We actually use all the ELF symbols, so there will be no
|
symbols. We actually use all the ELF symbols, so there will be no
|
||||||
space left over at the end. When we have all the symbols, we
|
space left over at the end. When we have all the symbols, we
|
||||||
build the caller's pointer vector. */
|
build the caller's pointer vector. */
|
||||||
|
|
||||||
if (! dynamic)
|
if (! dynamic)
|
||||||
{
|
{
|
||||||
@ -1421,7 +1417,6 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic)
|
|||||||
symbols, dynamic))
|
symbols, dynamic))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
asect->relocation = relents;
|
asect->relocation = relents;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
|
||||||
char*
|
char*
|
||||||
elf_core_file_failing_command (abfd)
|
elf_core_file_failing_command (abfd)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
@ -32,7 +31,6 @@ elf_core_file_failing_signal (abfd)
|
|||||||
return elf_tdata (abfd)->core_signal;
|
return elf_tdata (abfd)->core_signal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boolean
|
boolean
|
||||||
elf_core_file_matches_executable_p (core_bfd, exec_bfd)
|
elf_core_file_matches_executable_p (core_bfd, exec_bfd)
|
||||||
bfd *core_bfd;
|
bfd *core_bfd;
|
||||||
@ -40,7 +38,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd)
|
|||||||
{
|
{
|
||||||
char* corename;
|
char* corename;
|
||||||
|
|
||||||
/* xvecs must match if both are ELF files for the same target. */
|
/* xvecs must match if both are ELF files for the same target. */
|
||||||
|
|
||||||
if (core_bfd->xvec != exec_bfd->xvec)
|
if (core_bfd->xvec != exec_bfd->xvec)
|
||||||
{
|
{
|
||||||
@ -48,7 +46,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* See if the name in the corefile matches the executable name. */
|
/* See if the name in the corefile matches the executable name. */
|
||||||
|
|
||||||
corename = elf_tdata (core_bfd)->core_program;
|
corename = elf_tdata (core_bfd)->core_program;
|
||||||
if (corename != NULL)
|
if (corename != NULL)
|
||||||
@ -63,7 +61,6 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Core files are simply standard ELF formatted files that partition
|
/* Core files are simply standard ELF formatted files that partition
|
||||||
the file using the execution view of the file (program header table)
|
the file using the execution view of the file (program header table)
|
||||||
rather than the linking view. In fact, there is no section header
|
rather than the linking view. In fact, there is no section header
|
||||||
@ -97,17 +94,17 @@ elf_core_file_p (abfd)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check the magic number. */
|
/* Check the magic number. */
|
||||||
if (elf_file_p (&x_ehdr) == false)
|
if (elf_file_p (&x_ehdr) == false)
|
||||||
goto wrong;
|
goto wrong;
|
||||||
|
|
||||||
/* FIXME: Check EI_VERSION here ! */
|
/* FIXME: Check EI_VERSION here ! */
|
||||||
|
|
||||||
/* Check the address size ("class"). */
|
/* Check the address size ("class"). */
|
||||||
if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS)
|
if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS)
|
||||||
goto wrong;
|
goto wrong;
|
||||||
|
|
||||||
/* Check the byteorder. */
|
/* Check the byteorder. */
|
||||||
switch (x_ehdr.e_ident[EI_DATA])
|
switch (x_ehdr.e_ident[EI_DATA])
|
||||||
{
|
{
|
||||||
case ELFDATA2MSB: /* Big-endian */
|
case ELFDATA2MSB: /* Big-endian */
|
||||||
@ -122,14 +119,14 @@ elf_core_file_p (abfd)
|
|||||||
goto wrong;
|
goto wrong;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Give abfd an elf_obj_tdata. */
|
/* Give abfd an elf_obj_tdata. */
|
||||||
new_tdata =
|
new_tdata =
|
||||||
(struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata));
|
(struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata));
|
||||||
if (new_tdata == NULL)
|
if (new_tdata == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
elf_tdata (abfd) = new_tdata;
|
elf_tdata (abfd) = new_tdata;
|
||||||
|
|
||||||
/* Swap in the rest of the header, now that we have the byte order. */
|
/* Swap in the rest of the header, now that we have the byte order. */
|
||||||
i_ehdrp = elf_elfheader (abfd);
|
i_ehdrp = elf_elfheader (abfd);
|
||||||
elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp);
|
elf_swap_ehdr_in (abfd, &x_ehdr, i_ehdrp);
|
||||||
|
|
||||||
@ -173,7 +170,7 @@ elf_core_file_p (abfd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If there is no program header, or the type is not a core file, then
|
/* If there is no program header, or the type is not a core file, then
|
||||||
we are hosed. */
|
we are hosed. */
|
||||||
if (i_ehdrp->e_phoff == 0 || i_ehdrp->e_type != ET_CORE)
|
if (i_ehdrp->e_phoff == 0 || i_ehdrp->e_type != ET_CORE)
|
||||||
goto wrong;
|
goto wrong;
|
||||||
|
|
||||||
@ -186,7 +183,7 @@ elf_core_file_p (abfd)
|
|||||||
if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0)
|
if (bfd_seek (abfd, i_ehdrp->e_phoff, SEEK_SET) != 0)
|
||||||
goto wrong;
|
goto wrong;
|
||||||
|
|
||||||
/* Allocate space for the program headers. */
|
/* Allocate space for the program headers. */
|
||||||
i_phdrp = (Elf_Internal_Phdr *)
|
i_phdrp = (Elf_Internal_Phdr *)
|
||||||
bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum);
|
bfd_alloc (abfd, sizeof (*i_phdrp) * i_ehdrp->e_phnum);
|
||||||
if (!i_phdrp)
|
if (!i_phdrp)
|
||||||
@ -194,7 +191,7 @@ elf_core_file_p (abfd)
|
|||||||
|
|
||||||
elf_tdata (abfd)->phdr = i_phdrp;
|
elf_tdata (abfd)->phdr = i_phdrp;
|
||||||
|
|
||||||
/* Read and convert to internal form. */
|
/* Read and convert to internal form. */
|
||||||
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
|
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
|
||||||
{
|
{
|
||||||
Elf_External_Phdr x_phdr;
|
Elf_External_Phdr x_phdr;
|
||||||
@ -205,14 +202,14 @@ elf_core_file_p (abfd)
|
|||||||
elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex);
|
elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Process each program header. */
|
/* Process each program header. */
|
||||||
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
|
for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex)
|
||||||
{
|
{
|
||||||
if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex))
|
if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex))
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the machine architecture. */
|
/* Set the machine architecture. */
|
||||||
if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
|
if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0))
|
||||||
{
|
{
|
||||||
/* It's OK if this fails for the generic target. */
|
/* It's OK if this fails for the generic target. */
|
||||||
@ -220,7 +217,7 @@ elf_core_file_p (abfd)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save the entry point from the ELF header. */
|
/* Save the entry point from the ELF header. */
|
||||||
bfd_get_start_address (abfd) = i_ehdrp->e_entry;
|
bfd_get_start_address (abfd) = i_ehdrp->e_entry;
|
||||||
|
|
||||||
/* Let the backend double check the format and override global
|
/* Let the backend double check the format and override global
|
||||||
|
@ -115,7 +115,6 @@ is_global_symbol_definition (abfd, sym)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Search the symbol table of the archive element of the archive ABFD
|
/* Search the symbol table of the archive element of the archive ABFD
|
||||||
whoes archove map contains a mention of SYMDEF, and determine if
|
whoes archove map contains a mention of SYMDEF, and determine if
|
||||||
the symbol is defined in this element. */
|
the symbol is defined in this element. */
|
||||||
@ -628,7 +627,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
/* It's OK to change the type if either the existing symbol or the
|
/* It's OK to change the type if either the existing symbol or the
|
||||||
new symbol is weak unless it comes from a DT_NEEDED entry of
|
new symbol is weak unless it comes from a DT_NEEDED entry of
|
||||||
a shared object, in which case, the DT_NEEDED entry may not be
|
a shared object, in which case, the DT_NEEDED entry may not be
|
||||||
required at the run time. */
|
required at the run time. */
|
||||||
|
|
||||||
if ((! dt_needed && h->root.type == bfd_link_hash_defweak)
|
if ((! dt_needed && h->root.type == bfd_link_hash_defweak)
|
||||||
|| h->root.type == bfd_link_hash_undefweak
|
|| h->root.type == bfd_link_hash_undefweak
|
||||||
@ -684,7 +683,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
We prefer a non-weak definition in a shared library to a weak
|
We prefer a non-weak definition in a shared library to a weak
|
||||||
definition in the executable unless it comes from a DT_NEEDED
|
definition in the executable unless it comes from a DT_NEEDED
|
||||||
entry of a shared object, in which case, the DT_NEEDED entry
|
entry of a shared object, in which case, the DT_NEEDED entry
|
||||||
may not be required at the run time. */
|
may not be required at the run time. */
|
||||||
|
|
||||||
if (newdyn
|
if (newdyn
|
||||||
&& newdef
|
&& newdef
|
||||||
@ -830,7 +829,7 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash,
|
|||||||
followed by a non-weak definition in a shared object. In this
|
followed by a non-weak definition in a shared object. In this
|
||||||
case, we prefer the definition in the shared object unless it
|
case, we prefer the definition in the shared object unless it
|
||||||
comes from a DT_NEEDED entry of a shared object, in which case,
|
comes from a DT_NEEDED entry of a shared object, in which case,
|
||||||
the DT_NEEDED entry may not be required at the run time. */
|
the DT_NEEDED entry may not be required at the run time. */
|
||||||
if (olddef
|
if (olddef
|
||||||
&& ! dt_needed
|
&& ! dt_needed
|
||||||
&& h->root.type == bfd_link_hash_defweak
|
&& h->root.type == bfd_link_hash_defweak
|
||||||
@ -1218,7 +1217,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
runpath = 1;
|
runpath = 1;
|
||||||
rpath = 0;
|
rpath = 0;
|
||||||
}
|
}
|
||||||
/* Ignore DT_RPATH if we have seen DT_RUNPATH. */
|
/* Ignore DT_RPATH if we have seen DT_RUNPATH. */
|
||||||
if (!runpath && dyn.d_tag == DT_RPATH)
|
if (!runpath && dyn.d_tag == DT_RPATH)
|
||||||
{
|
{
|
||||||
struct bfd_link_needed_list *n, **pn;
|
struct bfd_link_needed_list *n, **pn;
|
||||||
@ -1957,7 +1956,7 @@ elf_link_add_object_symbols (abfd, info)
|
|||||||
|
|
||||||
/* The symbol from a DT_NEEDED object is referenced from
|
/* The symbol from a DT_NEEDED object is referenced from
|
||||||
the regular object to create a dynamic executable. We
|
the regular object to create a dynamic executable. We
|
||||||
have to make sure there is a DT_NEEDED entry for it. */
|
have to make sure there is a DT_NEEDED entry for it. */
|
||||||
|
|
||||||
dt_needed = false;
|
dt_needed = false;
|
||||||
oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr);
|
oldsize = _bfd_stringtab_size (elf_hash_table (info)->dynstr);
|
||||||
@ -3895,7 +3894,7 @@ elf_link_assign_sym_version (h, data)
|
|||||||
int version_index;
|
int version_index;
|
||||||
|
|
||||||
/* If we aren't going to export this symbol, we don't need
|
/* If we aren't going to export this symbol, we don't need
|
||||||
to worry about it. */
|
to worry about it. */
|
||||||
if (h->dynindx == -1)
|
if (h->dynindx == -1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -4413,7 +4412,7 @@ elf_bfd_final_link (abfd, info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now, reset REL_COUNT and REL_COUNT2 so that we can use them
|
/* Now, reset REL_COUNT and REL_COUNT2 so that we can use them
|
||||||
to count upwards while actually outputting the relocations. */
|
to count upwards while actually outputting the relocations. */
|
||||||
elf_section_data (o)->rel_count = 0;
|
elf_section_data (o)->rel_count = 0;
|
||||||
elf_section_data (o)->rel_count2 = 0;
|
elf_section_data (o)->rel_count2 = 0;
|
||||||
}
|
}
|
||||||
@ -4592,7 +4591,7 @@ elf_bfd_final_link (abfd, info)
|
|||||||
/* That wrote out all the local symbols. Finish up the symbol table
|
/* That wrote out all the local symbols. Finish up the symbol table
|
||||||
with the global symbols. Even if we want to strip everything we
|
with the global symbols. Even if we want to strip everything we
|
||||||
can, we still need to deal with those global symbols that got
|
can, we still need to deal with those global symbols that got
|
||||||
converted to local in a version script. */
|
converted to local in a version script. */
|
||||||
|
|
||||||
if (info->shared)
|
if (info->shared)
|
||||||
{
|
{
|
||||||
@ -5268,7 +5267,7 @@ elf_link_output_extsym (h, data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If a symbol is not defined locally, we clear the visibility
|
/* If a symbol is not defined locally, we clear the visibility
|
||||||
field. */
|
field. */
|
||||||
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
|
||||||
sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other);
|
sym.st_other ^= ELF_ST_VISIBILITY(sym.st_other);
|
||||||
|
|
||||||
@ -5772,7 +5771,7 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is a reloc against a local symbol. */
|
/* This is a reloc against a local symbol. */
|
||||||
|
|
||||||
*rel_hash = NULL;
|
*rel_hash = NULL;
|
||||||
isym = finfo->internal_syms + r_symndx;
|
isym = finfo->internal_syms + r_symndx;
|
||||||
@ -6404,22 +6403,22 @@ elf_gc_mark (info, sec, gc_mark_hook)
|
|||||||
{
|
{
|
||||||
elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s);
|
elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s);
|
||||||
if (ELF_ST_BIND (s.st_info) == STB_LOCAL)
|
if (ELF_ST_BIND (s.st_info) == STB_LOCAL)
|
||||||
rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s);
|
rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
h = sym_hashes[r_symndx - extsymoff];
|
h = sym_hashes[r_symndx - extsymoff];
|
||||||
rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL);
|
rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (r_symndx >= nlocsyms)
|
else if (r_symndx >= nlocsyms)
|
||||||
{
|
{
|
||||||
h = sym_hashes[r_symndx - extsymoff];
|
h = sym_hashes[r_symndx - extsymoff];
|
||||||
rsec = (*gc_mark_hook)(sec->owner, info, rel, h, NULL);
|
rsec = (*gc_mark_hook) (sec->owner, info, rel, h, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s);
|
elf_swap_symbol_in (input_bfd, &locsyms[r_symndx], &s);
|
||||||
rsec = (*gc_mark_hook)(sec->owner, info, rel, NULL, &s);
|
rsec = (*gc_mark_hook) (sec->owner, info, rel, NULL, &s);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsec && !rsec->gc_mark)
|
if (rsec && !rsec->gc_mark)
|
||||||
@ -6490,7 +6489,7 @@ elf_gc_sweep (info, gc_sweep_hook)
|
|||||||
if (internal_relocs == NULL)
|
if (internal_relocs == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
r = (*gc_sweep_hook)(o->owner, info, o, internal_relocs);
|
r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs);
|
||||||
|
|
||||||
if (!info->keep_memory)
|
if (!info->keep_memory)
|
||||||
free (internal_relocs);
|
free (internal_relocs);
|
||||||
@ -6543,7 +6542,7 @@ elf_gc_propagate_vtable_entries_used (h, okp)
|
|||||||
struct elf_link_hash_entry *h;
|
struct elf_link_hash_entry *h;
|
||||||
PTR okp;
|
PTR okp;
|
||||||
{
|
{
|
||||||
/* Those that are not vtables. */
|
/* Those that are not vtables. */
|
||||||
if (h->vtable_parent == NULL)
|
if (h->vtable_parent == NULL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
#include "opcode/ia64.h"
|
#include "opcode/ia64.h"
|
||||||
#include "elf/ia64.h"
|
#include "elf/ia64.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* THE RULES for all the stuff the linker creates --
|
* THE RULES for all the stuff the linker creates --
|
||||||
*
|
*
|
||||||
@ -188,7 +187,7 @@ static struct elfNN_ia64_local_hash_entry *elfNN_ia64_local_hash_lookup
|
|||||||
boolean create, boolean copy));
|
boolean create, boolean copy));
|
||||||
static void elfNN_ia64_dyn_sym_traverse
|
static void elfNN_ia64_dyn_sym_traverse
|
||||||
PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info,
|
PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info,
|
||||||
boolean (*func)(struct elfNN_ia64_dyn_sym_info *, PTR),
|
boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR),
|
||||||
PTR info));
|
PTR info));
|
||||||
static boolean elfNN_ia64_create_dynamic_sections
|
static boolean elfNN_ia64_create_dynamic_sections
|
||||||
PARAMS ((bfd *abfd, struct bfd_link_info *info));
|
PARAMS ((bfd *abfd, struct bfd_link_info *info));
|
||||||
@ -711,7 +710,7 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again)
|
|||||||
else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE)
|
else if (isym.st_shndx > 0 && isym.st_shndx < SHN_LORESERVE)
|
||||||
tsec = bfd_section_from_elf_index (abfd, isym.st_shndx);
|
tsec = bfd_section_from_elf_index (abfd, isym.st_shndx);
|
||||||
else
|
else
|
||||||
continue; /* who knows. */
|
continue; /* who knows. */
|
||||||
|
|
||||||
toff = isym.st_value;
|
toff = isym.st_value;
|
||||||
}
|
}
|
||||||
@ -1156,7 +1155,6 @@ elfNN_ia64_modify_segment_map (abfd)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* According to the Tahoe assembler spec, all labels starting with a
|
/* According to the Tahoe assembler spec, all labels starting with a
|
||||||
'.' are local. */
|
'.' are local. */
|
||||||
|
|
||||||
@ -1204,7 +1202,7 @@ elfNN_ia64_local_hash_table_init (ht, abfd, new)
|
|||||||
bfd *abfd ATTRIBUTE_UNUSED;
|
bfd *abfd ATTRIBUTE_UNUSED;
|
||||||
new_hash_entry_func new;
|
new_hash_entry_func new;
|
||||||
{
|
{
|
||||||
memset (ht, 0, sizeof(*ht));
|
memset (ht, 0, sizeof (*ht));
|
||||||
return bfd_hash_table_init (&ht->root, new);
|
return bfd_hash_table_init (&ht->root, new);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1227,7 +1225,7 @@ elfNN_ia64_new_loc_hash_entry (entry, table, string)
|
|||||||
|
|
||||||
/* Initialize our local data. All zeros, and definitely easier
|
/* Initialize our local data. All zeros, and definitely easier
|
||||||
than setting a handful of bit fields. */
|
than setting a handful of bit fields. */
|
||||||
memset (ret, 0, sizeof(*ret));
|
memset (ret, 0, sizeof (*ret));
|
||||||
|
|
||||||
/* Call the allocation method of the superclass. */
|
/* Call the allocation method of the superclass. */
|
||||||
ret = ((struct elfNN_ia64_local_hash_entry *)
|
ret = ((struct elfNN_ia64_local_hash_entry *)
|
||||||
@ -1255,7 +1253,7 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string)
|
|||||||
|
|
||||||
/* Initialize our local data. All zeros, and definitely easier
|
/* Initialize our local data. All zeros, and definitely easier
|
||||||
than setting a handful of bit fields. */
|
than setting a handful of bit fields. */
|
||||||
memset (ret, 0, sizeof(*ret));
|
memset (ret, 0, sizeof (*ret));
|
||||||
|
|
||||||
/* Call the allocation method of the superclass. */
|
/* Call the allocation method of the superclass. */
|
||||||
ret = ((struct elfNN_ia64_link_hash_entry *)
|
ret = ((struct elfNN_ia64_link_hash_entry *)
|
||||||
@ -1500,7 +1498,7 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create)
|
|||||||
/* Construct a string for use in the elfNN_ia64_local_hash_table.
|
/* Construct a string for use in the elfNN_ia64_local_hash_table.
|
||||||
The name describes what was once anonymous memory. */
|
The name describes what was once anonymous memory. */
|
||||||
|
|
||||||
len = sizeof(void*)*2 + 1 + sizeof(bfd_vma)*4 + 1 + 1;
|
len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1;
|
||||||
len += 10; /* %p slop */
|
len += 10; /* %p slop */
|
||||||
|
|
||||||
addr_name = alloca (len);
|
addr_name = alloca (len);
|
||||||
@ -2504,7 +2502,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info)
|
|||||||
if (! bfd_elfNN_add_dynamic_entry (info, DT_RELA, 0)
|
if (! bfd_elfNN_add_dynamic_entry (info, DT_RELA, 0)
|
||||||
|| ! bfd_elfNN_add_dynamic_entry (info, DT_RELASZ, 0)
|
|| ! bfd_elfNN_add_dynamic_entry (info, DT_RELASZ, 0)
|
||||||
|| ! bfd_elfNN_add_dynamic_entry (info, DT_RELAENT,
|
|| ! bfd_elfNN_add_dynamic_entry (info, DT_RELAENT,
|
||||||
sizeof(ElfNN_External_Rela)))
|
sizeof (ElfNN_External_Rela)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (reltext)
|
if (reltext)
|
||||||
@ -2541,7 +2539,7 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type)
|
|||||||
case R_IA64_LDXMOV:
|
case R_IA64_LDXMOV:
|
||||||
return bfd_reloc_ok;
|
return bfd_reloc_ok;
|
||||||
|
|
||||||
/* Instruction relocations. */
|
/* Instruction relocations. */
|
||||||
|
|
||||||
case R_IA64_IMM14: opnd = IA64_OPND_IMM14; break;
|
case R_IA64_IMM14: opnd = IA64_OPND_IMM14; break;
|
||||||
|
|
||||||
@ -2686,7 +2684,7 @@ elfNN_ia64_install_value (abfd, hit_addr, val, r_type)
|
|||||||
case 0: shift = 5; break;
|
case 0: shift = 5; break;
|
||||||
case 1: shift = 14; hit_addr += 3; break;
|
case 1: shift = 14; hit_addr += 3; break;
|
||||||
case 2: shift = 23; hit_addr += 6; break;
|
case 2: shift = 23; hit_addr += 6; break;
|
||||||
case 3: return bfd_reloc_notsupported; /* shouldn't happen... */
|
case 3: return bfd_reloc_notsupported; /* shouldn't happen... */
|
||||||
}
|
}
|
||||||
dword = bfd_get_64 (abfd, hit_addr);
|
dword = bfd_get_64 (abfd, hit_addr);
|
||||||
insn = (dword >> shift) & 0x1ffffffffffLL;
|
insn = (dword >> shift) & 0x1ffffffffffLL;
|
||||||
@ -2765,7 +2763,7 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type,
|
|||||||
bfd_elfNN_swap_reloca_out (abfd, &outrel,
|
bfd_elfNN_swap_reloca_out (abfd, &outrel,
|
||||||
((ElfNN_External_Rela *) srel->contents
|
((ElfNN_External_Rela *) srel->contents
|
||||||
+ srel->reloc_count++));
|
+ srel->reloc_count++));
|
||||||
BFD_ASSERT (sizeof(ElfNN_External_Rela) * srel->reloc_count
|
BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count
|
||||||
<= srel->_cooked_size);
|
<= srel->_cooked_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3057,7 +3055,7 @@ elfNN_ia64_final_link (abfd, info)
|
|||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
(_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
|
(_("%s: short data segment overflowed (0x%lx >= 0x400000)"),
|
||||||
bfd_get_filename (abfd),
|
bfd_get_filename (abfd),
|
||||||
(unsigned long)(max_short_vma - min_short_vma));
|
(unsigned long) (max_short_vma - min_short_vma));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if ((gp_val > min_short_vma
|
else if ((gp_val > min_short_vma
|
||||||
@ -3873,7 +3871,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info)
|
|||||||
|
|
||||||
case DT_RELASZ:
|
case DT_RELASZ:
|
||||||
/* Do not have RELASZ include JMPREL. This makes things
|
/* Do not have RELASZ include JMPREL. This makes things
|
||||||
easier on ld.so. This is not what the rest of BFD set up. */
|
easier on ld.so. This is not what the rest of BFD set up. */
|
||||||
dyn.d_un.d_val -= (ia64_info->minplt_entries
|
dyn.d_un.d_val -= (ia64_info->minplt_entries
|
||||||
* sizeof (ElfNN_External_Rela));
|
* sizeof (ElfNN_External_Rela));
|
||||||
break;
|
break;
|
||||||
@ -3903,7 +3901,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info)
|
|||||||
|
|
||||||
/* ELF file flag handling: */
|
/* ELF file flag handling: */
|
||||||
|
|
||||||
/* Function to keep IA-64 specific file flags. */
|
/* Function to keep IA-64 specific file flags. */
|
||||||
static boolean
|
static boolean
|
||||||
elfNN_ia64_set_private_flags (abfd, flags)
|
elfNN_ia64_set_private_flags (abfd, flags)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
|
Loading…
Reference in New Issue
Block a user