a.c (454B)
1 /* Deduplication: comdat_fn is defined in both TUs as STB_WEAK. 2 * The linker must keep exactly one copy; test_main verifies the result. 3 * Note: true SHT_GROUP / COMDAT dedup is verified separately via 4 * test/elf/cases/13_comdat.c roundtrip; this case tests the linker's 5 * weak-merge path end-to-end through exec and JIT. */ 6 __attribute__((noinline, weak)) int comdat_fn(void) { return 42; } 7 8 int test_main(void) { return comdat_fn() == 42 ? 0 : 1; }