- Removed extraneous and/or oversized(?) align from linker script - Handle init_array properly - Remove legacy init code paths (.ctors, .init) - Don't do nonstandard interrupt mode handling by default
26 lines
514 B
C
26 lines
514 B
C
int test = 0x12345;
|
|
int test2;
|
|
|
|
#pragma GCC diagnostic ignored "-Wprio-ctor-dtor"
|
|
__attribute__((constructor(0))) static void setup_qingke() {
|
|
asm volatile(
|
|
// Undocumented "Configure pipelining and instruction prediction"
|
|
"li t0, 0x1f\n"
|
|
"csrw 0xbc0, t0\n"
|
|
);
|
|
}
|
|
|
|
__attribute__((constructor)) static void constructor() {
|
|
test2 = 0x5678;
|
|
}
|
|
|
|
__attribute__((destructor)) static void destructor() {
|
|
test2 = 0x9abc;
|
|
}
|
|
|
|
int main(void) {
|
|
test++;
|
|
test2--;
|
|
return 123;
|
|
}
|