From: Ian Lance Taylor Date: Fri, 28 Feb 1997 02:07:54 +0000 (+0000) Subject: * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=35a3e78edb9d4a3ef98f975587752325c9be860f;p=binutils-gdb.git * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label to _bfd_is_local_label_name. (bfd_target): Likewise. * syms.c (bfd_is_local_label): Define as function, not macro. (bfd_is_local_name): Define. * libbfd.c (bfd_generic_is_local_label_name): Rename from bfd_generic_is_local_label, and take a string rather than a symbol. * libbfd-in.h (_bfd_nosymbols_bfd_is_local_label): Don't define. (_bfd_nosymbols_bfd_is_local_label_name): Define. (bfd_generic_is_local_label): Don't declare. (bfd_generic_is_local_label_name): Declare. * bfd-in2.h, libbfd.h: Rebuild. * All backends: Change local_label to local_label_name. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 36d7204d353..6eb6dda288c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,20 @@ Thu Feb 27 18:36:23 1997 Ian Lance Taylor + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Change _bfd_is_local_label + to _bfd_is_local_label_name. + (bfd_target): Likewise. + * syms.c (bfd_is_local_label): Define as function, not macro. + (bfd_is_local_name): Define. + * libbfd.c (bfd_generic_is_local_label_name): Rename from + bfd_generic_is_local_label, and take a string rather than a + symbol. + * libbfd-in.h (_bfd_nosymbols_bfd_is_local_label): Don't define. + (_bfd_nosymbols_bfd_is_local_label_name): Define. + (bfd_generic_is_local_label): Don't declare. + (bfd_generic_is_local_label_name): Declare. + * bfd-in2.h, libbfd.h: Rebuild. + * All backends: Change local_label to local_label_name. + * elf32-mips.c (struct mips_got_info): Add assigned_gotno field. (mips_elf_relocate_got_local): Change return type to boolean. Don't assume that the first zero entry is unassigned; instead, use diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 23a60695507..631348a6819 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -539,6 +539,7 @@ struct ecoff_extr; struct symbol_cache_entry; struct bfd_link_info; struct bfd_link_hash_entry; +struct bfd_elf_version_tree; #endif extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd)); extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value)); @@ -606,10 +607,12 @@ extern struct bfd_link_needed_list *bfd_elf_get_needed_list PARAMS ((bfd *, struct bfd_link_info *)); extern boolean bfd_elf32_size_dynamic_sections PARAMS ((bfd *, const char *, const char *, boolean, const char *, - const char * const *, struct bfd_link_info *, struct sec **)); + const char * const *, struct bfd_link_info *, struct sec **, + struct bfd_elf_version_tree *)); extern boolean bfd_elf64_size_dynamic_sections PARAMS ((bfd *, const char *, const char *, boolean, const char *, - const char * const *, struct bfd_link_info *, struct sec **)); + const char * const *, struct bfd_link_info *, struct sec **, + struct bfd_elf_version_tree *)); extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); @@ -2080,8 +2083,11 @@ typedef struct symbol_cache_entry boolean bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym)); -#define bfd_is_local_label(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_local_label,(abfd, sym)) +boolean +bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name)); + +#define bfd_is_local_label_name(abfd, name) \ + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) #define bfd_canonicalize_symtab(abfd, location) \ BFD_SEND (abfd, _bfd_canonicalize_symtab,\ (abfd, location)) @@ -2610,7 +2616,7 @@ CAT(NAME,_get_symtab),\ CAT(NAME,_make_empty_symbol),\ CAT(NAME,_print_symbol),\ CAT(NAME,_get_symbol_info),\ -CAT(NAME,_bfd_is_local_label),\ +CAT(NAME,_bfd_is_local_label_name),\ CAT(NAME,_get_lineno),\ CAT(NAME,_find_nearest_line),\ CAT(NAME,_bfd_make_debug_symbol),\ @@ -2629,7 +2635,7 @@ CAT(NAME,_minisymbol_to_symbol) struct symbol_cache_entry *, symbol_info *)); #define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) - boolean (*_bfd_is_local_label) PARAMS ((bfd *, asymbol *)); + boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index ae07e91d9c0..d7c3b1dd444 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1,5 +1,5 @@ /* Support for the generic parts of most COFF variants, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -2255,6 +2255,9 @@ coff_compute_section_file_positions (abfd) previous = current; } + /* Make sure the relocations are aligned. */ + sofar = BFD_ALIGN (sofar, 1 << COFF_DEFAULT_SECTION_ALIGNMENT_POWER); + obj_relocbase (abfd) = sofar; abfd->output_has_begun = true; @@ -2728,7 +2731,7 @@ coff_write_object_contents (abfd) #define __A_MAGIC_SET__ #endif /* A29K */ #ifdef TIC80 - internal_a.magic = TIC80MAGIC; + internal_a.magic = TIC80_ARCH_MAGIC; #define __A_MAGIC_SET__ #endif /* TIC80 */ #ifdef I860 @@ -3901,8 +3904,8 @@ static CONST bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data #endif -#ifndef coff_bfd_is_local_label -#define coff_bfd_is_local_label bfd_generic_is_local_label +#ifndef coff_bfd_is_local_label_name +#define coff_bfd_is_local_label_name bfd_generic_is_local_label_name #endif #ifndef coff_read_minisymbols #define coff_read_minisymbols _bfd_generic_read_minisymbols diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index bed4ed34604..eed0da661d4 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -1,5 +1,5 @@ /* Target definitions for NN-bit ELF - Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -112,8 +112,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_bfd_set_private_flags \ ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true) #endif -#ifndef bfd_elfNN_bfd_is_local_label -#define bfd_elfNN_bfd_is_local_label bfd_generic_is_local_label +#ifndef bfd_elfNN_bfd_is_local_label_name +#define bfd_elfNN_bfd_is_local_label_name bfd_generic_is_local_label_name #endif #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound diff --git a/bfd/evax-alpha.c b/bfd/evax-alpha.c index f48e84c1c56..c97db588a4f 100644 --- a/bfd/evax-alpha.c +++ b/bfd/evax-alpha.c @@ -78,7 +78,7 @@ static void evax_print_symbol PARAMS ((bfd *abfd, PTR file, asymbol *symbol, bfd_print_symbol_type how)); static void evax_get_symbol_info PARAMS ((bfd *abfd, asymbol *symbol, symbol_info *ret)); -static boolean evax_bfd_is_local_label PARAMS ((bfd *abfd, asymbol *symbol)); +static boolean evax_bfd_is_local_label_name PARAMS ((bfd *abfd, const char *)); static alent *evax_get_lineno PARAMS ((bfd *abfd, asymbol *symbol)); static boolean evax_find_nearest_line PARAMS ((bfd *abfd, asection *section, asymbol **symbols, bfd_vma offset, @@ -1136,12 +1136,12 @@ evax_get_symbol_info (abfd, symbol, ret) a compiler generated local label, else return false. */ static boolean -evax_bfd_is_local_label (abfd, symbol) +evax_bfd_is_local_label_name (abfd, name) bfd *abfd; - asymbol *symbol; + const char *name; { #if EVAX_DEBUG - evax_debug (1, "evax_bfd_is_local_label(%p, %p)\n", abfd, symbol); + evax_debug (1, "evax_bfd_is_local_label_name(%p, %s)\n", abfd, name); #endif return false; } diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index bc016fbb4db..e378aff7c63 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -1,6 +1,6 @@ /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) - Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. Written by Cygnus Support. ** NOTE: libbfd.h is a GENERATED file. Don't change it; instead, @@ -259,8 +259,8 @@ extern boolean _bfd_archive_coff_construct_extended_name_table ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) #define _bfd_nosymbols_get_symbol_info \ ((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void) -#define _bfd_nosymbols_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) +#define _bfd_nosymbols_bfd_is_local_label_name \ + ((boolean (*) PARAMS ((bfd *, const char *))) bfd_false) #define _bfd_nosymbols_get_lineno \ ((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr) #define _bfd_nosymbols_find_nearest_line \ @@ -339,7 +339,7 @@ extern boolean _bfd_generic_set_section_contents /* Generic routine to determine of the given symbol is a local label. */ -extern boolean bfd_generic_is_local_label PARAMS ((bfd *, asymbol *)); +extern boolean bfd_generic_is_local_label_name PARAMS ((bfd *, const char *)); /* Generic minisymbol routines. */ extern long _bfd_generic_read_minisymbols @@ -425,6 +425,20 @@ extern bfd_reloc_status_type _bfd_final_link_relocate extern bfd_reloc_status_type _bfd_relocate_contents PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *)); +/* Link stabs in sections in the first pass. */ + +extern boolean _bfd_link_section_stabs + PARAMS ((bfd *, PTR *, asection *, asection *, PTR *)); + +/* Write out the .stab section when linking stabs in sections. */ + +extern boolean _bfd_write_section_stabs + PARAMS ((bfd *, asection *, PTR *, bfd_byte *)); + +/* Write out the .stabstr string table when linking stabs in sections. */ + +extern boolean _bfd_write_stab_strings PARAMS ((bfd *, PTR *)); + /* Create a string table. */ extern struct bfd_strtab_hash *_bfd_stringtab_init PARAMS ((void)); @@ -468,15 +482,6 @@ void bfd_assert PARAMS ((const char*,int)); FILE * bfd_cache_lookup_worker PARAMS ((bfd *)); extern bfd *bfd_last_cache; - -/* Now Steve, what's the story here? */ -#ifdef lint -#define itos(x) "l" -#define stoi(x) 1 -#else -#define itos(x) ((char*)(x)) -#define stoi(x) ((int)(x)) -#endif /* List of supported target vectors, and the default vector (if bfd_default_vector[0] is NULL, there is no default). */ @@ -501,5 +506,13 @@ extern boolean _bfd_ecoff_get_accumulated_ss PARAMS ((PTR, bfd_byte *)); extern bfd_vma _bfd_get_gp_value PARAMS ((bfd *)); extern void _bfd_set_gp_value PARAMS ((bfd *, bfd_vma)); +/* Function shared by the COFF and ELF SH backends, which have no + other common header files. */ + +extern boolean _bfd_sh_align_load_span + PARAMS ((bfd *, asection *, bfd_byte *, + boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma), + PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *)); + /* And more follows */ diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 66cc841cb74..a0864ea6a3b 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -259,8 +259,8 @@ extern boolean _bfd_archive_coff_construct_extended_name_table ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) #define _bfd_nosymbols_get_symbol_info \ ((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void) -#define _bfd_nosymbols_bfd_is_local_label \ - ((boolean (*) PARAMS ((bfd *, asymbol *))) bfd_false) +#define _bfd_nosymbols_bfd_is_local_label_name \ + ((boolean (*) PARAMS ((bfd *, const char *))) bfd_false) #define _bfd_nosymbols_get_lineno \ ((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr) #define _bfd_nosymbols_find_nearest_line \ @@ -339,7 +339,7 @@ extern boolean _bfd_generic_set_section_contents /* Generic routine to determine of the given symbol is a local label. */ -extern boolean bfd_generic_is_local_label PARAMS ((bfd *, asymbol *)); +extern boolean bfd_generic_is_local_label_name PARAMS ((bfd *, const char *)); /* Generic minisymbol routines. */ extern long _bfd_generic_read_minisymbols @@ -766,6 +766,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_M32R_HI16_ULO", "BFD_RELOC_M32R_HI16_SLO", "BFD_RELOC_M32R_LO16", + "BFD_RELOC_M32R_SDA16", /* end-sanitize-m32r */ /* start-sanitize-v850 */ diff --git a/bfd/syms.c b/bfd/syms.c index 9959f0b6be6..23a1c19823f 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -1,5 +1,6 @@ /* Generic symbol-table support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 + Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -342,8 +343,33 @@ SYNOPSIS DESCRIPTION Return true if the given symbol @var{sym} in the BFD @var{abfd} is a compiler generated local label, else return false. -.#define bfd_is_local_label(abfd, sym) \ -. BFD_SEND (abfd, _bfd_is_local_label,(abfd, sym)) +*/ + +boolean +bfd_is_local_label (abfd, sym) + bfd *abfd; + asymbol *sym; +{ + if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0) + return false; + return bfd_is_local_label_name (abfd, sym->name); +} + +/* +FUNCTION + bfd_is_local_label_name + +SYNOPSIS + boolean bfd_is_local_label_name(bfd *abfd, const char *name); + +DESCRIPTION + Return true if a symbol with the name @var{name} in the BFD + @var{abfd} is a compiler generated local label, else return + false. This just checks whether the name has the form of a + local label. + +.#define bfd_is_local_label_name(abfd, name) \ +. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) */ /* @@ -621,7 +647,7 @@ DESCRIPTION Not enough memory exists to create private data for @var{osec}. .#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ -. BFD_SEND (ibfd, _bfd_copy_private_symbol_data, \ +. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ . (ibfd, isymbol, obfd, osymbol)) */ diff --git a/bfd/targets.c b/bfd/targets.c index 89f56e55a40..c7bb0cc2799 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -1,5 +1,5 @@ /* Generic target-file-type support for the BFD library. - Copyright 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -340,7 +340,7 @@ The general target vector. .CAT(NAME,_make_empty_symbol),\ .CAT(NAME,_print_symbol),\ .CAT(NAME,_get_symbol_info),\ -.CAT(NAME,_bfd_is_local_label),\ +.CAT(NAME,_bfd_is_local_label_name),\ .CAT(NAME,_get_lineno),\ .CAT(NAME,_find_nearest_line),\ .CAT(NAME,_bfd_make_debug_symbol),\ @@ -359,7 +359,7 @@ The general target vector. . struct symbol_cache_entry *, . symbol_info *)); .#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) -. boolean (*_bfd_is_local_label) PARAMS ((bfd *, asymbol *)); +. boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); . . alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); . boolean (*_bfd_find_nearest_line) PARAMS ((bfd *abfd,