commit
bba5c8a39a
109 files changed
+14085
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// 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;
|
||||
}
|
||||
Reference in new issue
Block a user