From: Richard Henderson Date: Tue, 5 May 1998 23:49:26 +0000 (+0000) Subject: * srec.c (srec_write_symbols): Use bfd_is_local_label rather than X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4aa65bb8c1e9ce165e775bef10f0ecc88baa650c;p=binutils-gdb.git * srec.c (srec_write_symbols): Use bfd_is_local_label rather than an ad-hoc test. Kill bogus #if 0 code. * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local. PR 13455 --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 74213851386..3891adccf12 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,16 @@ +Tue May 5 16:47:54 1998 Richard Henderson + + * srec.c (srec_write_symbols): Use bfd_is_local_label rather than + an ad-hoc test. Kill bogus #if 0 code. + * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local. + +Mon May 4 16:10:33 1998 Ian Lance Taylor + + * sunos.c (sunos_check_dynamic_reloc): Don't use the PLT address + when generating a normal executable for a symbol defined in a + regular file. When copying a reloc into the output file, adjust + the addend for a PC relative reloc against a global symbol. + Mon May 4 10:08:18 1998 Tom Tromey * libbfd.h: Rebuilt. diff --git a/bfd/srec.c b/bfd/srec.c index 8370c0ef98a..3b1e0e73d2a 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -1,5 +1,6 @@ /* BFD back-end for s-record objects. - Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . This file is part of BFD, the Binary File Descriptor library. @@ -109,6 +110,7 @@ DESCRIPTION #include "libiberty.h" #include +static void srec_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static void srec_print_symbol PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); static void srec_init PARAMS ((void)); @@ -285,7 +287,7 @@ srec_bad_byte (abfd, lineno, c, error) buf[1] = '\0'; } (*_bfd_error_handler) - ("%s:%d: Unexpected character `%s' in S-record file\n", + (_("%s:%d: Unexpected character `%s' in S-record file\n"), bfd_get_filename (abfd), lineno, buf); bfd_set_error (bfd_error_bad_value); } @@ -405,7 +407,7 @@ srec_scan (abfd) while ((c = srec_get_byte (abfd, &error)) != EOF && ! isspace (c)) { - if (p - symbuf >= alc) + if ((unsigned int) (p - symbuf) >= alc) { char *n; @@ -1057,26 +1059,7 @@ srec_write_symbols (abfd) for (i = 0; i < count; i++) { asymbol *s = table[i]; -#if 0 - int len = strlen (s->name); - - /* If this symbol has a .[ocs] in it, it's probably a file name - and we'll output that as the module name */ - - if (len > 3 && s->name[len - 2] == '.') - { - int l; - sprintf (buffer, "$$ %s\r\n", s->name); - l = strlen (buffer); - if (bfd_write (buffer, l, 1, abfd) != l) - return false; - } - else -#endif - if (s->flags & (BSF_GLOBAL | BSF_LOCAL) - && (s->flags & BSF_DEBUGGING) == 0 - && s->name[0] != '.' - && s->name[0] != 't') + if (! bfd_is_local_label (abfd, s)) { /* Just dump out non debug symbols */ bfd_size_type l; @@ -1217,7 +1200,7 @@ srec_get_symtab (abfd, alocation) } /*ARGSUSED*/ -void +static void srec_get_symbol_info (ignore_abfd, symbol, ret) bfd *ignore_abfd; asymbol *symbol; diff --git a/bfd/syms.c b/bfd/syms.c index 0feacbc3e03..30fb74c352a 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -354,6 +354,8 @@ bfd_is_local_label (abfd, sym) return false; if (sym->name == NULL) return false; + if (sym->flags & BSF_DEBUGGING) + return true; return bfd_is_local_label_name (abfd, sym->name); } @@ -728,9 +730,9 @@ struct indexentry bfd_vma val; bfd_byte *stab; bfd_byte *str; - bfd_byte *directory_name; - bfd_byte *file_name; - bfd_byte *function_name; + char *directory_name; + char *file_name; + char *function_name; }; /* Compare two indexentry structures. This is called via qsort. */ @@ -774,7 +776,7 @@ struct stab_find_info struct indexentry *cached_indexentry; bfd_vma cached_offset; bfd_byte *cached_stab; - bfd_byte *cached_file_name; + char *cached_file_name; #endif /* Saved ptr to malloc'ed filename. */