libconvert 496 B

123456789101112131415161718192021222324
  1. #! /bin/sh
  2. #
  3. # Convert coff libc to a coff-encapsulated libc
  4. # suitable for linking with the GNU linker.
  5. #
  6. # Extract all members of /lib/libc.a (using coff ar).
  7. # Convert each using robotussin.
  8. # Create new libc (using gnu ar) with members in the same order as coff libc.
  9. # set -e makes this script exit if any command gets an error
  10. set -e
  11. mkdir tmp
  12. cd tmp
  13. /bin/ar x /lib/libc.a
  14. for i in *.o
  15. do
  16. ../robotussin $i x
  17. mv x $i
  18. done
  19. rm -f ../libc.a
  20. ../ar rs ../libc.a `/bin/ar t /lib/libc.a`
  21. cd ..