aboutsummaryrefslogtreecommitdiff
path: root/bfd/TODO
blob: 26fd83b0f7c7d660751d5cdf18b0a4c888fc81df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Things that still need to be handled: -*- Text -*-

 o - change the memory usage to reflect the message which follows the
     page break.
 o - implement bfd_abort, which should close the bfd but not alter the
     filesystem.
 o - update the bfd doc; write a how-to-write-a-backend doc.
 o - change reloc handling as per Steve's suggestion.
     (more details please.....)

Changing the way bfd uses memory.  The new convention is simple: 

 o - bfd will never write into user-supplied memory, nor attempt to
     free it.
 o - closing a bfd may reclaim all bfd-allocated memory associated
     with that bfd.
 - - bfd_target_list will be the one exception; you must reclaim the
     returned vector yourself.

Interface implications are minor (get_symcount_upper_bound will go
away; bfd_cannicalize_symtab will allocate its own memory, etc).

Certain operations consume a lot of memory; for them manual
reclaimation is available:

 o - bfd_canonicalize_symtab will return a pointer to a
     null-terminated vector of symbols.  Subsequent calls may or may
     not return the same pointer.
     bfd_canonicalize_relocs will do the same; returning a pointer to
     an array of arelocs.  Calling this function will read symbols in
     too.

 o - bfd_reclaim_relocs will free the memory used by these relocs.
     the symbols will be untouched.
     bfd_reclaim_symtab (ne bfd_reclaim_symbol_table) will free the
     memory allocated by canonialize_symtab.  
     Since relocations point to symbols, any relocations obtained by a
     call to bfd_canonicalize_relocs will be reclaimed as well.

 o - if you don't call the reclaim_ functions, the memory will be
     reclaimed at bfd_close time.