_bfd_coff_pointerize_aux_hook.
(coff_pointerize_aux_hook): Define as a function if RS6000COFF_C
or I960, and as 0 otherwise.
(bfd_coff_std_swap_table): Initialize new field.
* libcoff.h: Rebuild.
* coffgen.c (coff_pointerize_aux): Change parameters to take
symbol pointer instead of type and class, and to take aux index.
Call _bfd_coff_pointerize_aux_hook if it is defined.
(coff_get_normalized_symtab): Always call coff_pointerize_aux.
* coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields.
* coff-mips.c (mips_ecoff_backend_data): Likewise.
Fri Oct 6 12:04:02 1995 Ian Lance Taylor <ian@cygnus.com>
+ * coffcode.h (bfd_coff_backend_data): Add new field
+ _bfd_coff_pointerize_aux_hook.
+ (coff_pointerize_aux_hook): Define as a function if RS6000COFF_C
+ or I960, and as 0 otherwise.
+ (bfd_coff_std_swap_table): Initialize new field.
+ * libcoff.h: Rebuild.
+ * coffgen.c (coff_pointerize_aux): Change parameters to take
+ symbol pointer instead of type and class, and to take aux index.
+ Call _bfd_coff_pointerize_aux_hook if it is defined.
+ (coff_get_normalized_symtab): Always call coff_pointerize_aux.
+ * coff-alpha.c (alpha_ecoff_backend_data): Initialize all fields.
+ * coff-mips.c (mips_ecoff_backend_data): Likewise.
+
* coff-rs6000.c: Add full support for AIX archives. Rewrite old
read-only/host-only support.
alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
alpha_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
_bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
},
/* Supported architecture. */
bfd_arch_alpha,
mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
_bfd_ecoff_mkobject_hook, _bfd_ecoff_styp_to_sec_flags,
_bfd_ecoff_set_alignment_hook, _bfd_ecoff_slurp_symbol_table,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
},
/* Supported architecture. */
bfd_arch_mips,
. boolean (*_bfd_coff_symname_in_debug) PARAMS ((
. bfd *abfd,
. struct internal_syment *sym));
+. boolean (*_bfd_coff_pointerize_aux_hook) PARAMS ((
+. bfd *abfd,
+. combined_entry_type *table_base,
+. combined_entry_type *symbol,
+. unsigned int indaux,
+. combined_entry_type *aux));
. void (*_bfd_coff_reloc16_extra_cases) PARAMS ((
. bfd *abfd,
. struct bfd_link_info *link_info,
#endif
+#ifdef RS6000COFF_C
+
+/* We don't want to pointerize the csect auxent of a C_EXT or C_HIDEXT
+ symbol. */
+
+static boolean coff_pointerize_aux_hook
+ PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
+ unsigned int, combined_entry_type *));
+
+/*ARGSUSED*/
+static boolean
+coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
+ bfd *abfd;
+ combined_entry_type *table_base;
+ combined_entry_type *symbol;
+ unsigned int indaux;
+ combined_entry_type *aux;
+{
+ int class = symbol->u.syment.n_sclass;
+
+ /* Return true if we don't want to pointerize this aux entry, which
+ is the case for the last aux entry for a C_EXT or C_HIDEXT
+ symbol. */
+ return ((class == C_EXT || class == C_HIDEXT)
+ && indaux + 1 == symbol->u.syment.n_numaux);
+}
+
+#else
+#ifdef I960
+
+/* We don't want to pointerize bal entries. */
+
+static boolean coff_pointerize_aux_hook
+ PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
+ unsigned int, combined_entry_type *));
+
+/*ARGSUSED*/
+static boolean
+coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux)
+ bfd *abfd;
+ combined_entry_type *table_base;
+ combined_entry_type *symbol;
+ unsigned int indaux;
+ combined_entry_type *aux;
+{
+ /* Return true if we don't want to pointerize this aux entry, which
+ is the case for the lastfirst aux entry for a C_LEAFPROC symbol. */
+ return indaux == 1 && symbol->u.syment.n_sclass == C_LEAFPROC;
+}
+
+#else /* ! I960 */
+
+#define coff_pointerize_aux_hook 0
+
+#endif /* ! I960 */
+#endif /* ! RS6000COFF_C */
+
/*
SUBSUBSECTION
Writing relocations
coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in,
coff_swap_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook,
coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook,
- coff_slurp_symbol_table, symname_in_debug_hook,
+ coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook,
coff_reloc16_extra_cases, coff_reloc16_estimate,
coff_sym_is_global, coff_compute_section_file_positions,
coff_start_final_link, coff_relocate_section, coff_rtype_to_howto,
static boolean coff_write_native_symbol
PARAMS ((bfd *, coff_symbol_type *, unsigned int *, bfd_size_type *,
asection **, bfd_size_type *));
+static void coff_pointerize_aux
+ PARAMS ((bfd *, combined_entry_type *, combined_entry_type *,
+ unsigned int, combined_entry_type *));
#define STRING_SIZE_SIZE (4)
strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name));
name[sizeof (hdr->s_name)] = 0;
- return_section = bfd_make_section (abfd, name);
- if (return_section == NULL)
- return_section = bfd_coff_make_section_hook (abfd, name);
-
- /* Handle several sections of the same name. For example, if an executable
- has two .bss sections, GDB better be able to find both of them
- (PR 3562). */
- if (return_section == NULL)
- return_section = bfd_make_section_anyway (abfd, name);
-
+ return_section = bfd_make_section_anyway (abfd, name);
if (return_section == NULL)
return false;
pointers to syments. */
static void
-coff_pointerize_aux (abfd, table_base, type, class, auxent)
+coff_pointerize_aux (abfd, table_base, symbol, indaux, auxent)
bfd *abfd;
combined_entry_type *table_base;
- unsigned int type;
- unsigned int class;
+ combined_entry_type *symbol;
+ unsigned int indaux;
combined_entry_type *auxent;
{
+ int type = symbol->u.syment.n_type;
+ int class = symbol->u.syment.n_sclass;
+
+ if (coff_backend_info (abfd)->_bfd_coff_pointerize_aux_hook)
+ {
+ if ((*coff_backend_info (abfd)->_bfd_coff_pointerize_aux_hook)
+ (abfd, table_base, symbol, indaux, auxent))
+ return;
+ }
+
/* Don't bother if this is a file or a section */
if (class == C_STAT && type == T_NULL)
return;
&& auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l > 0)
{
auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.p =
- (table_base
- + auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l);
+ table_base + auxent->u.auxent.x_sym.x_fcnary.x_fcn.x_endndx.l;
auxent->fix_end = 1;
}
/* A negative tagndx is meaningless, but the SCO 3.2v4 cc can
symbol_ptr->u.syment.n_sclass,
i, symbol_ptr->u.syment.n_numaux,
&(internal_ptr->u.auxent));
- /* Remember that bal entries arn't pointerized */
- if (i != 1 || symbol_ptr->u.syment.n_sclass != C_LEAFPROC)
- {
-
- coff_pointerize_aux (abfd,
- internal,
- symbol_ptr->u.syment.n_type,
- symbol_ptr->u.syment.n_sclass,
- internal_ptr);
- }
-
+ coff_pointerize_aux (abfd, internal, symbol_ptr, i,
+ internal_ptr);
}
}
bfd *abfd,
PTR internal_scnhdr,
const char *name));
- asection *(*_bfd_make_section_hook) PARAMS ((
- bfd *abfd,
- char *name));
void (*_bfd_set_alignment_hook) PARAMS ((
bfd *abfd,
asection *sec,
boolean (*_bfd_coff_symname_in_debug) PARAMS ((
bfd *abfd,
struct internal_syment *sym));
+ boolean (*_bfd_coff_pointerize_aux_hook) PARAMS ((
+ bfd *abfd,
+ combined_entry_type *table_base,
+ combined_entry_type *symbol,
+ unsigned int indaux,
+ combined_entry_type *aux));
void (*_bfd_coff_reloc16_extra_cases) PARAMS ((
bfd *abfd,
struct bfd_link_info *link_info,
#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name)\
((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook) (abfd, scnhdr, name))
-#define bfd_coff_make_section_hook(abfd, name)\
- ((coff_backend_info (abfd)->_bfd_make_section_hook) (abfd, name))
-
#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))