diff options
author | obrien <obrien@FreeBSD.org> | 2002-04-12 19:33:52 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2002-04-12 19:33:52 +0000 |
commit | 18ff9f4f1bddd11c341a37177885ac89fcccedd9 (patch) | |
tree | b6180daa6d6e558ce86214f98d103e01ff4e70ff /contrib/binutils/bfd/syms.c | |
parent | 1d1ccbf8e10277966ecf3c150370a50c9e184b35 (diff) | |
download | FreeBSD-src-18ff9f4f1bddd11c341a37177885ac89fcccedd9.zip FreeBSD-src-18ff9f4f1bddd11c341a37177885ac89fcccedd9.tar.gz |
Import of Binutils from the FSF 2.12 branch.
(this fixes several linker problems and coredumps)
These bits are taken from the FSF anoncvs repo on 10-April-2002 13:24 Zulu
Diffstat (limited to 'contrib/binutils/bfd/syms.c')
-rw-r--r-- | contrib/binutils/bfd/syms.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c index b25306e..4309c0d 100644 --- a/contrib/binutils/bfd/syms.c +++ b/contrib/binutils/bfd/syms.c @@ -545,23 +545,25 @@ struct section_to_type adding entries. Since it is so short, a linear search is used. */ static const struct section_to_type stt[] = { - {"*DEBUG*", 'N'}, {".bss", 'b'}, - {"zerovars", 'b'}, /* MRI .bss */ + {"code", 't'}, /* MRI .text */ {".data", 'd'}, - {"vars", 'd'}, /* MRI .data */ + {"*DEBUG*", 'N'}, + {".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */ + {".drectve", 'i'}, /* MSVC's .drective section */ + {".edata", 'e'}, /* MSVC's .edata (export) section */ + {".fini", 't'}, /* ELF fini section */ + {".idata", 'i'}, /* MSVC's .idata (import) section */ + {".init", 't'}, /* ELF init section */ + {".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */ {".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'}, - {"code", 't'}, /* MRI .text */ - {".drectve", 'i'}, /* MSVC's .drective section */ - {".idata", 'i'}, /* MSVC's .idata (import) section */ - {".edata", 'e'}, /* MSVC's .edata (export) section */ - {".pdata", 'p'}, /* MSVC's .pdata (stack unwind) section */ - {".debug", 'N'}, /* MSVC's .debug (non-standard debug syms) */ + {"vars", 'd'}, /* MRI .data */ + {"zerovars", 'b'}, /* MRI .bss */ {0, 0} }; @@ -1236,9 +1238,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, for (; stab < (indexentry+1)->stab; stab += STABSIZE) { - boolean done; + boolean done, saw_line, saw_func; bfd_vma val; + saw_line = false; + saw_func = false; done = false; switch (stab[TYPEOFF]) @@ -1259,7 +1263,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, /* A line number. The value is relative to the start of the current function. */ val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF); - if (val <= offset) + /* If this line starts before our desired offset, or if it's + the first line we've been able to find, use it. The + !saw_line check works around a bug in GCC 2.95.3, which emits + the first N_SLINE late. */ + if (!saw_line || val <= offset) { *pline = bfd_get_16 (abfd, stab + DESCOFF); @@ -1272,11 +1280,14 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, } if (val > offset) done = true; + saw_line = true; break; case N_FUN: case N_SO: - done = true; + if (saw_func || saw_line) + done = true; + saw_func = true; break; } |