cybersecurity · intermediate · ~15 min · safe pentest lab

ELF symbol binding

Extract the binding nibble.

Challenge

An ELF symbol's st_info packs binding in the high nibble. Implement int symbol_binding(unsigned char info) returning info >> 4 (0=LOCAL, 1=GLOBAL, 2=WEAK).

Starter code

int symbol_binding(unsigned char info) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.