OLD | NEW |
1 /* Generic symbol-table support for the BFD library. | 1 /* Generic symbol-table support for the BFD library. |
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
3 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 | 3 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2012 |
4 Free Software Foundation, Inc. | 4 Free Software Foundation, Inc. |
5 Written by Cygnus Support. | 5 Written by Cygnus Support. |
6 | 6 |
7 This file is part of BFD, the Binary File Descriptor library. | 7 This file is part of BFD, the Binary File Descriptor library. |
8 | 8 |
9 This program is free software; you can redistribute it and/or modify | 9 This program is free software; you can redistribute it and/or modify |
10 it under the terms of the GNU General Public License as published by | 10 it under the terms of the GNU General Public License as published by |
11 the Free Software Foundation; either version 3 of the License, or | 11 the Free Software Foundation; either version 3 of the License, or |
12 (at your option) any later version. | 12 (at your option) any later version. |
13 | 13 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 Writing of a symbol table is automatic when a BFD open for | 100 Writing of a symbol table is automatic when a BFD open for |
101 writing is closed. The application attaches a vector of | 101 writing is closed. The application attaches a vector of |
102 pointers to pointers to symbols to the BFD being written, and | 102 pointers to pointers to symbols to the BFD being written, and |
103 fills in the symbol count. The close and cleanup code reads | 103 fills in the symbol count. The close and cleanup code reads |
104 through the table provided and performs all the necessary | 104 through the table provided and performs all the necessary |
105 operations. The BFD output code must always be provided with an | 105 operations. The BFD output code must always be provided with an |
106 ``owned'' symbol: one which has come from another BFD, or one | 106 ``owned'' symbol: one which has come from another BFD, or one |
107 which has been created using <<bfd_make_empty_symbol>>. Here is an | 107 which has been created using <<bfd_make_empty_symbol>>. Here is an |
108 example showing the creation of a symbol table with only one element: | 108 example showing the creation of a symbol table with only one element: |
109 | 109 |
| 110 | #include "sysdep.h" |
110 | #include "bfd.h" | 111 | #include "bfd.h" |
111 | int main (void) | 112 | int main (void) |
112 | { | 113 | { |
113 | bfd *abfd; | 114 | bfd *abfd; |
114 | asymbol *ptrs[2]; | 115 | asymbol *ptrs[2]; |
115 | asymbol *new; | 116 | asymbol *new; |
116 | | 117 | |
117 | abfd = bfd_openw ("foo","a.out-sunos-big"); | 118 | abfd = bfd_openw ("foo","a.out-sunos-big"); |
118 | bfd_set_format (abfd, bfd_object); | 119 | bfd_set_format (abfd, bfd_object); |
119 | new = bfd_make_empty_symbol (abfd); | 120 | new = bfd_make_empty_symbol (abfd); |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 string is in our own local storage anyhow. */ | 1415 string is in our own local storage anyhow. */ |
1415 s = strchr (indexentry->function_name, ':'); | 1416 s = strchr (indexentry->function_name, ':'); |
1416 if (s != NULL) | 1417 if (s != NULL) |
1417 *s = '\0'; | 1418 *s = '\0'; |
1418 | 1419 |
1419 *pfnname = indexentry->function_name; | 1420 *pfnname = indexentry->function_name; |
1420 } | 1421 } |
1421 | 1422 |
1422 return TRUE; | 1423 return TRUE; |
1423 } | 1424 } |
OLD | NEW |