[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
bfd_make_empty_symbol
. Here is an
example showing the creation of a symbol table with only one element:
#include "bfd.h" int main (void) { bfd *abfd; asymbol *ptrs[2]; asymbol *new; abfd = bfd_openw ("foo","a.out-sunos-big"); bfd_set_format (abfd, bfd_object); new = bfd_make_empty_symbol (abfd); new->name = "dummy_symbol"; new->section = bfd_make_section_old_way (abfd, ".text"); new->flags = BSF_GLOBAL; new->value = 0x12345; ptrs[0] = new; ptrs[1] = 0; bfd_set_symtab (abfd, ptrs, 1); bfd_close (abfd); return 0; } ./makesym nm foo 00012345 A dummy_symbol |
Many formats cannot represent arbitrary symbol information; for
instance, the a.out
object format does not allow an
arbitrary number of sections. A symbol pointing to a section
which is not one of .text
, .data
or .bss
cannot
be described.