Files
faumaray bba5c8a39a initial commit
Signed-off-by: Aleksey Selihov <faumaray@gmail.com>
2026-05-22 02:40:32 +03:00

19 lines
438 B
C

// Stateful library using BSS (zero-init global) and .data (init global).
// Exercises PC32 relocs from .text to .bss/.data across segments.
static int call_count = 0; // BSS: zero-initialized
static int step = 1; // .data: initialized to 1
void counter_reset(void) {
call_count = 0;
}
int counter_step_up(void) {
call_count += step;
return call_count;
}
int counter_get(void) {
return call_count;
}