dynamic ELF -> static executable?



Hi,

Is there a way to combinbe a dynamic ELF executable with the shared libraries it refers to into a static (and hence more portable) version of the executable? The linux loader does something quite similar but I could not coerce the linker 'ld' to do it, e.g.,

  ld -Bstatic -o <static_exec> <dyn_exec> <libraries>

creates an executable that segfaults when run.

Thanks for any help or pointers,

Denes
.