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

Use LIEF i.s.o. manually dumping symbols #19

Open
adam-urbanczyk opened this issue Apr 10, 2020 · 3 comments
Open

Use LIEF i.s.o. manually dumping symbols #19

adam-urbanczyk opened this issue Apr 10, 2020 · 3 comments

Comments

@adam-urbanczyk
Copy link
Member

https://github.com/lief-project/LIEF

@jmwright
Copy link
Member

jmwright commented May 1, 2021

I was going to ask how to generate symbols_mangled_*.dat, and found this issue. I'm trying to generate one for OpenBSD. How do you do it now? Will you just call leif.parse in a loop on all the OCCT .so files and collect the output into a file?

@adam-urbanczyk
Copy link
Member Author

For OCP the script is here: https://github.com/CadQuery/OCP/blob/master/dump_symbols.py . For a general case you'd need to write your own.

@greyltc
Copy link
Contributor

greyltc commented May 19, 2021

I do it in Linux like this:

  sed 's,7.5.1,7.5.2,g' -i dump_symbols.py
  # get symbols
  local _structure_needed="dummy/lib_linux/"
  mkdir -p ${_structure_needed}
  ln -s /usr/lib dummy/lib_linux/.
  msg2 "Old symbols:"
  ls -lh *.dat
  rm *.dat
  msg2 "Dumping symbols..."
  python dump_symbols.py dummy
  msg2 "Dump complete. New symbols:"
  ls -lh *.dat
  rm -rf ${_structure_needed}
  find -maxdepth 1 -name '*.dat' -exec ln -sf ../{} pywrap/{} \;

which gives output that looks like this in my builds:

==> Starting build()...
  -> Old symbols:
-rw-r--r-- 1 user user 4.6M May 19 16:36 symbols_mangled_linux.dat
-rw-r--r-- 1 user user 5.0M May 19 16:36 symbols_mangled_mac.dat
-rw-r--r-- 1 user user 3.8M May 19 16:36 symbols_mangled_win.dat
  -> Dumping symbols...
  -> Dump complete. New symbols:
-rw-r--r-- 1 user user 7.0M May 19 16:36 symbols_mangled_linux.dat
-rw-r--r-- 1 user user    0 May 19 16:36 symbols_mangled_mac.dat
-rw-r--r-- 1 user user    0 May 19 16:36 symbols_mangled_win.dat

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

3 participants