aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-09-29 16:30:12 +0000
committerIan Lance Taylor <ian@airs.com>1994-09-29 16:30:12 +0000
commitec591fcf4593685c5b3cae35a3ad6ce87f127c26 (patch)
tree3e632d4e35fee0bd220523d774111f6e60000da3 /bfd
parente90bd60df3c40a3a693f502f9e65eefdb377c75c (diff)
downloadgdb-ec591fcf4593685c5b3cae35a3ad6ce87f127c26.zip
gdb-ec591fcf4593685c5b3cae35a3ad6ce87f127c26.tar.gz
gdb-ec591fcf4593685c5b3cae35a3ad6ce87f127c26.tar.bz2
* syms.c (stt): Add .rdata and .rodata.
PR 5714.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/syms.c50
2 files changed, 40 insertions, 14 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 86b2b11..63d8e90 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 4154cbf..07d5b05 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 <<asymbols>> 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);