Linking my program fails with strange errors. Why?
Very simple, the linker (actually called the binder), cannot get the
memory it needs, either because your ulimits are too low or because you
don't have sufficient paging space. Since the linker is quite different
>from normal Unix linkers and actually does much more than these, it also
uses a lot of virtual memory. It is not unusual to need 10000 pages (of
4k) or more to execute a fairly complex linking.
If you get 'BUMP error', either ulimits or paging is too low, if you get
'Binder killed by signal 9' your paging is too low.
First, check your memory and data ulimits; in korn shell 'ulimit -a' will
show all limits and 'ulimit -m 99999' and 'ulimit -d 99999' will
increase the maximum memory and data respectively to some high values.
If this was not your problem, you don't have enough paging space.
If you will or can not increase your paging space, you could try this:
- Do you duplicate libraries on the ld command line? That is never
- Do more users link simultaneously? Try having only one linking going
on at any time.
- Do a partwise linking, i.e. you link some objects/libraries with the
-r option to allow the temporary output to have unresolved references,
then link with the rest of your objects/libraries. This can be split
up as much as you want, and will make each step use less virtual memory.
If you follow this scheme, only adding one object or archive at a
time, you will actually emulate the behavior of other Unix linkers.
If you decide to add more paging space, you should consider adding a new
paging space on a second hard disk, as opposed to just increasing the
existing one. Doing the latter could make you run out of free space on
your first harddisk. It is more involved to shrink a paging space
but easier to delete one.