home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume42 / elfdis / part02 / sparc_relocations < prev    next >
Text File  |  1994-05-08  |  419b  |  18 lines

  1. #!/bin/sh
  2. #
  3. # print out a working switch() based on sparc relocations
  4. #
  5. echo "#include <stdio.h>"
  6. echo "#include <elf.h>"
  7. echo "#include <sys/elf_SPARC.h>"
  8. echo "char *relocation_type(type)"
  9. echo "int type;"
  10. echo "{"
  11. echo "char *bpType = NULL;"
  12. echo "switch (type) {"
  13. grep R_SPARC /usr/include/sys/elf_SPARC.h |
  14. awk '/^/ { printf "\tcase %s: bpType = \"%s\"; break;\n", $2, $2}'
  15. echo "}"
  16. echo "return bpType;"
  17. echo "}"
  18.