Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sample to static link a compiled dynamic library into a compiled binary #12

Open
lunixbochs opened this issue Mar 28, 2017 · 1 comment

Comments

@lunixbochs
Copy link
Owner

lunixbochs commented Mar 28, 2017

  1. combine segments (not by extending binary's existing segments, but by adding new ones)
  2. change relocation offsets for the library and add its relocations to the binary's relo table
  3. add all library symbols to binary relo table
  4. don't think I need to preemptively do relocations for any symbols from the library, as long as ld.so considers the binary's own symtab when loading
  5. add all library symbols to symtab
  6. merge library dependencies
  7. re-emit combined binary!
  8. repeat as necessary
@lunixbochs
Copy link
Owner Author

lunixbochs commented Mar 29, 2017

  1. update .init, .fini / ctors/dtors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant