| www.delorie.com/gnu/docs/binutils/bfd_63.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ 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"
main()
{
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] = (asymbol *)0;
bfd_set_symtab(abfd, ptrs, 1);
bfd_close(abfd);
}
./makesym
nm foo
00012345 A dummy_symbol
|
Many formats cannot represent arbitary symbol information; for
instance, the a.out object format does not allow an
arbitary number of sections. A symbol pointing to a section
which is not one of .text, .data or .bss cannot
be described.
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |