gcunused.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* gcunused.h: Routines to remove unused sections
  2. Copyright (C) 2002-2003 Sebastian Reichelt
  3. Copyright (C) 2003-2005 Kevin Kofler
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  15. #ifndef GCUNUSED_H
  16. #define GCUNUSED_H
  17. #include "generic.h"
  18. #include "data.h"
  19. // Remove all unused sections.
  20. void RemoveUnusedSections (PROGRAM *Program);
  21. // The following 2 functions are currently needed only for external data
  22. // variable support.
  23. #ifdef DATA_VAR_SUPPORT
  24. // Mark the section containing __main as Referenced. This is a kludge
  25. // compensating for the fact that the startup section referencing __main has not
  26. // been imported at that stage.
  27. void MarkMainSection (PROGRAM *Program);
  28. // Clear the Referenced flag of all sections, in order to be able to run a
  29. // second RemoveUnusedSections pass at a later point.
  30. void ResetReferencedFlags (PROGRAM *Program);
  31. #endif /* DATA_VAR_SUPPORT */
  32. #endif