Your second version works with this script:
GLIBC_2.7 {
global: __isoc99_sscanf;
local: *;
};
Using -Wl,--version-script=script.txt
, however, I don't know how to access the original sscanf@GLIBC_2.4
.
Anyway, perhaps you would want to use -D_GNU_SOURCE
instead; to avoid __isoc99_sscanf
altogether.