attr_p2_09_visibility_hidden.c (498B)
1 /* Phase 2: __attribute__((visibility("hidden"))) on a function sets the 2 * ELF symbol visibility to STV_HIDDEN (Mach-O: N_PEXT). Visibility is 3 * not observable at runtime within a single TU; the symbol-table check 4 * lives in a separate ELF-inspecting integration harness. Here we only 5 * confirm the program compiles and the function is callable. */ 6 int hidden_fn(void) __attribute__((visibility("hidden"))); 7 8 int hidden_fn(void) { return 13; } 9 10 int test_main(void) { return hidden_fn() - 13; }