From: Ian Lance Taylor Date: Thu, 29 Sep 1994 16:30:12 +0000 (+0000) Subject: * syms.c (stt): Add .rdata and .rodata. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec591fcf4593685c5b3cae35a3ad6ce87f127c26;p=binutils-gdb.git * syms.c (stt): Add .rdata and .rodata. PR 5714. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 86b2b111a4a..63d8e901b0f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +Thu Sep 29 12:29:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * syms.c (stt): Add .rdata and .rodata. + Wed Sep 28 13:35:05 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) * reloc.c (bfd_install_relocation): Cast data_start to bfd_byte * diff --git a/bfd/syms.c b/bfd/syms.c index 4154cbfd831..07d5b05fea9 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -61,12 +61,15 @@ SUBSECTION allocating storage, and the actual reading process. This is an excerpt from an application which reads the symbol table: -| unsigned int storage_needed; +| long storage_needed; | asymbol **symbol_table; -| unsigned int number_of_symbols; -| unsigned int i; +| long number_of_symbols; +| long i; | -| storage_needed = get_symtab_upper_bound (abfd); +| storage_needed = bfd_get_symtab_upper_bound (abfd); +| +| if (storage_needed < 0) +| FAIL | | if (storage_needed == 0) { | return ; @@ -76,6 +79,9 @@ SUBSECTION | number_of_symbols = | bfd_canonicalize_symtab (abfd, symbol_table); | +| if (number_of_symbols < 0) +| FAIL +| | for (i = 0; i < number_of_symbols; i++) { | process_symbol (symbol_table[i]); | } @@ -282,17 +288,31 @@ SUBSECTION /* FUNCTION - get_symtab_upper_bound + bfd_get_symtab_upper_bound DESCRIPTION Return the number of bytes required to store a vector of pointers to <> for all the symbols in the BFD @var{abfd}, including a terminal NULL pointer. If there are no symbols in - the BFD, then return 0. + the BFD, then return 0. If an error occurs, return -1. + +.#define bfd_get_symtab_upper_bound(abfd) \ +. BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + +*/ -.#define get_symtab_upper_bound(abfd) \ -. BFD_SEND (abfd, _get_symtab_upper_bound, (abfd)) +/* +FUNCTION + bfd_is_local_label +SYNOPSIS + boolean bfd_is_local_label(bfd *abfd, asymbol *sym); + +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)) */ /* @@ -429,9 +449,11 @@ static CONST struct section_to_type stt[] = {"*DEBUG*", 'N'}, {".bss", 'b'}, {".data", 'd'}, - {".sbss", 's'}, /* Small BSS (uninitialized data) */ - {".scommon", 'c'}, /* Small common */ - {".sdata", 'g'}, /* Small initialized data */ + {".rdata", 'r'}, /* Read only data. */ + {".rodata", 'r'}, /* Read only data. */ + {".sbss", 's'}, /* Small BSS (uninitialized data). */ + {".scommon", 'c'}, /* Small common. */ + {".sdata", 'g'}, /* Small initialized data. */ {".text", 't'}, {0, 0} }; @@ -477,14 +499,14 @@ bfd_decode_symclass (symbol) if (bfd_is_com_section (symbol->section)) return 'C'; - if (symbol->section == &bfd_und_section) + if (bfd_is_und_section (symbol->section)) return 'U'; - if (symbol->section == &bfd_ind_section) + if (bfd_is_ind_section (symbol->section)) return 'I'; if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL))) return '?'; - if (symbol->section == &bfd_abs_section) + if (bfd_is_abs_section (symbol->section)) c = 'a'; else if (symbol->section) c = coff_section_type (symbol->section->name);