You copied the Doc URL to your clipboard.

Program design when exploiting the C library

The functions you must re-implement depend on how much of the library functionality you require:

  • If you want only the compiler support functions for division, structure copy, and floating-point arithmetic, you must provide __rt_raise(). This also enables very simple library functions such as those in errno.h, setjmp.h, and most of string.h to work.

  • If you call setlocale() explicitly, locale-dependent functions are activated. This enables you to use the atoi family, sprintf(), sscanf(), and the functions in ctype.h.

  • Programs that use floating-point must call _fp_init(). If you select software floating-point in --fpmode=ieee_fixed or --fpmode=ieee_full mode, the program must also provide __rt_fp_status_addr().

  • Implementing high-level input/output support is necessary for functions that use fprintf() or fputs(). The high-level output functions depend on fputc() and ferror(). The high-level input functions depend on fgetc() and __backspace().

Implementing these functions and the heap enables you to use almost the entire library.