defs.awk 571 B

123456789101112131415161718192021222324252627
  1. /^[ ]*\.endp/ { need_endp = 1 }
  2. /^[ ]*\.end/ { need_end = 1 }
  3. /^[ ]*\.align/ { if($2 > max) max = $2; }
  4. END {
  5. if(need_endp)
  6. {
  7. print "#define END_INIT .endp _init";
  8. print "#define END_FINI .endp _fini";
  9. } else if(need_end)
  10. {
  11. print "#define END_INIT .end _init";
  12. print "#define END_FINI .end _fini";
  13. }
  14. else
  15. {
  16. print "#define END_INIT";
  17. print "#define END_FINI";
  18. }
  19. if(max)
  20. print "#define ALIGN .align", max;
  21. else
  22. print "#define ALIGN";
  23. print "#include <libc-symbols.h>";
  24. #print "weak_extern (__gmon_start__)";
  25. }