search for: strongalias

Displaying 7 results from an estimated 7 matches for "strongalias".

2017 Jan 13
6
Weak symbol/alias semantics
...out ThinLTO, and am a little confused. Current (non-ThinLTO) behavior in some cases seems to depend on opt level. Example: $ cat weak12main.c extern void test2(); int main() { test2(); } $ cat weak1.c #include <stdio.h> void weakalias() __attribute__((weak, alias ("f"))); void strongalias() __attribute__((alias ("f"))); void f () __attribute__ ((weak)); void f() { printf("In weak1.c:f\n"); } void test1() { printf("Call f() from weak1.c:\n"); f(); printf("Call weakalias() from weak1.c:\n"); weakalias(); printf("Call strongalia...
2017 Jan 14
3
Weak symbol/alias semantics
...> > Hi Teresa, > > I think that to answer your question correctly it is helpful to consider what is going on at the object file level. For your test1.c we conceptually have a .text section containing the body of f, and then three symbols: > > .weak f > f = .text > .globl strongalias > strongalias = .text > .weak weakalias > weakalias = .text > > Note that f, strongalias and weakalias are not related at all, except that they happen to point to the same place. If f is overridden by a symbol in another object file, it does not affect the symbols strongalias and we...
2017 Jan 18
2
Weak symbol/alias semantics
...out when they are both in > > comdats. > > In the above example the "link/connection" is not broken. The original > @x and @y still refer to the same data, it is just that neither is used > in the final linked object. > Ok, thanks. But how does that property work the strongalias case from the original email. E.g.: @f = weak global ... @strongalias = alias @f What we had concluded was that it should be transformed into the following when this copy of @f is non-prevailing: @f = external global @f.llvm.1 = internal global ... // Internalized copy of original @f @strongal...
2017 Jan 14
4
Weak symbol/alias semantics
...gt; Hi Teresa, > > I think that to answer your question correctly it is helpful to consider > what is going on at the object file level. For your test1.c we conceptually > have a .text section containing the body of f, and then three symbols: > > .weak f > f = .text > .globl strongalias > strongalias = .text > .weak weakalias > weakalias = .text > > Note that f, strongalias and weakalias are not related at all, except that > they happen to point to the same place. If f is overridden by a symbol in > another object file, it does not affect the symbols strongali...
2017 Jan 14
4
Weak symbol/alias semantics
...gt;> >> I think that to answer your question correctly it is helpful to consider what is going on at the object file level. For your test1.c we conceptually have a .text section containing the body of f, and then three symbols: >> >> .weak f >> f = .text >> .globl strongalias >> strongalias = .text >> .weak weakalias >> weakalias = .text >> >> Note that f, strongalias and weakalias are not related at all, except that they happen to point to the same place. If f is overridden by a symbol in another object file, it does not affect the symbol...
2017 Jan 18
2
Weak symbol/alias semantics
...estion correctly it is helpful to consider what is going on at the object file level. For your test1.c we conceptually have a .text section containing the body of f, and then three symbols: >>>>> >>>>> .weak f >>>>> f = .text >>>>> .globl strongalias >>>>> strongalias = .text >>>>> .weak weakalias >>>>> weakalias = .text >>>>> >>>>> Note that f, strongalias and weakalias are not related at all, except that they happen to point to the same place. If f is overridden by a...
2017 Jan 18
2
Weak symbol/alias semantics
...ample: > > > > $ cat weak12main.c > > extern void test2(); > > int main() { > > test2(); > > } > > > > $ cat weak1.c > > #include <stdio.h> > > > > void weakalias() __attribute__((weak, alias ("f"))); > > void strongalias() __attribute__((alias ("f"))); > > > > void f () __attribute__ ((weak)); > > void f() > > { > > printf("In weak1.c:f\n"); > > } > > void test1() { > > printf("Call f() from weak1.c:\n"); > > f(); > >...