* Jan Hubicka: >> It's sometimes useful to define multiple versions for a single symbol. >> For maximum binutils compatibility, you would have to use intermediate >> aliases. __attribute__ ((__symver__ ("foo@VERS_1", "foo@@VERS_2"))) >> could turn into this: >> >> .set foo_v1.symver.1, foo_v1 >> .symver foo_v1.symver.1, foo_v1@VERS_1 >> .set foo_v1.symver.2, foo_v1 >> .symver foo_v1.symver.2, foo_v1@@VERS_2 > > I was originaly supporting multiple symvers like: > __attribute__ ((__symver__ ("foo@VERS_1"))) int > __attribute__ ((__symver__ ("foo@VERS_2"))) int > foo_v1 (void) > { > } > > but then noticed it is rejected by gas.
Yeah, I think that failure is somewhat dependent on the target and the GAS version. > I intended to support: > > __attribute__ ((__symver__ ("foo@VERS_1"))) int > foo_v1 (void) > { > } > > int symver_foo_v1 (void) > __attribute__ ((__symver__ ("foo@VERS_2"))) > __attribute__ ((alias ("foo_v1"))) That's a bit of a mouthful. We probably could hide it behind a macro using __COUNTER. > It would be prettier to support former but we need an exported symbol > name for the second alis, right? I assumed that .symver would make the versioned alias global, but sadly it does not. You are right, you currently need to start with a global symbol. Maybe there is a way around that. I'm going to ask on the binutils list.