(should have been on gcc-help I believe)

On Sun, 1 Apr 2018, Max Filippov wrote:

On Sun, Apr 1, 2018 at 5:33 AM, Jason Vas Dias <jason.vas.d...@gmail.com> wrote:
Aha!  But how to determine the mangled name beforehand ?

Even if I compile the object without the alias, then inspect
the object with objdump, there is no mangled symbol
_ZL3foov defined in the object file .

So I must run some name mangler /  generator as a
pre-processing step to get the correct mangled name
string ?

I guess so. Or you could define foo with C linkage:

    extern "C" {
         static inline __attribute__((always_inline))
         void foo(void){}
    };

    static inline __attribute__((always_inline,alias("foo")))
    void bar(void);

Or you can use an asm label to specify some arbitrary name.

--
Marc Glisse

Reply via email to