search for: weakalias

Displaying 12 results from an estimated 12 matches for "weakalias".

2017 Jan 13
6
Weak symbol/alias semantics
...copy in the alias's module? I looked at some examples without 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...
2017 Jan 14
3
Weak symbol/alias semantics
...o 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 weakalias, so we still need to make them point t...
2017 Jan 14
4
Weak symbol/alias semantics
...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 > weakalias, so we still need to mak...
2017 Jan 14
4
Weak symbol/alias semantics
...orrectly 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 weakalias, so we still need to make...
2017 Jan 18
2
Weak symbol/alias semantics
...evel. 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...
2017 Jan 18
2
Weak symbol/alias semantics
...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() { > >...
2016 Dec 27
0
ThinLTO promotion is ending up with "invalid" IR before IR-Linking
...p selectCallee() we > specifically prevent importing of aliases that would result in the aliasee > becoming available_externally. Presumably the resulting IRLinked dest > module looks legit, otherwise we would have later verifier failures. > > > So the source module is: > > @weakalias = weak alias void (...), bitcast (void ()* @globalfunc1 to void > (...)*) > define void @globalfunc1() #0 { > entry: > ret void > } > > But we turn globalfunc1 into available_externally in > renameModuleForThinLTO(), which make the alias invalid. > > We don’t import...
2016 Dec 23
6
ThinLTO promotion is ending up with "invalid" IR before IR-Linking
...ToImport set. But in FunctionImport.cpp selectCallee() we specifically prevent importing of aliases that would result in the aliasee becoming available_externally. Presumably the resulting IRLinked dest module looks legit, otherwise we would have later verifier failures. So the source module is: @weakalias = weak alias void (...), bitcast (void ()* @globalfunc1 to void (...)*) define void @globalfunc1() #0 { entry: ret void } But we turn globalfunc1 into available_externally in renameModuleForThinLTO(), which make the alias invalid. We don’t import the IR so the destination module is OK. 36 &gt...
2016 Dec 23
2
ThinLTO promotion is ending up with "invalid" IR before IR-Linking
...ToImport set. But in FunctionImport.cpp selectCallee() we specifically prevent importing of aliases that would result in the aliasee becoming available_externally. Presumably the resulting IRLinked dest module looks legit, otherwise we would have later verifier failures. So the source module is: @weakalias = weak alias void (...), bitcast (void ()* @globalfunc1 to void (...)*) define void @globalfunc1() #0 { entry: ret void } But we turn globalfunc1 into available_externally in renameModuleForThinLTO(), which make the alias invalid. We don’t import the IR so the destination module is OK. 36 I...
2016 Dec 23
0
ThinLTO promotion is ending up with "invalid" IR before IR-Linking
On Thu, Dec 22, 2016 at 8:55 PM, Mehdi Amini <mehdi.amini at apple.com> wrote: > Hey, > > As I’m playing with Metadata lazy-loading, I added a verifier right before > running the IRLinker in FunctionImport.cpp, and it does not pass (on > current trunk) in a few cases. One that I looked at ended up with aliases > pointing to available_externally functions for instance. >
2016 Dec 23
1
ThinLTO promotion is ending up with "invalid" IR before IR-Linking
...FunctionImport.cpp selectCallee() we specifically prevent importing of aliases that would result in the aliasee becoming available_externally. Presumably the resulting IRLinked dest module looks legit, otherwise we would have later verifier failures. > > So the source module is: > > @weakalias = weak alias void (...), bitcast (void ()* @globalfunc1 to void (...)*) > define void @globalfunc1() #0 { > entry: > ret void > } > > But we turn globalfunc1 into available_externally in renameModuleForThinLTO(), which make the alias invalid. > > We don’t import the IR s...
2016 Dec 23
0
ThinLTO promotion is ending up with "invalid" IR before IR-Linking
...() we specifically prevent importing of aliases that would result in the aliasee becoming available_externally. Presumably the resulting IRLinked dest module looks legit, otherwise we would have later verifier failures. >>> >>> So the source module is: >>> >>> @weakalias = weak alias void (...), bitcast (void ()* @globalfunc1 to void (...)*) >>> define void @globalfunc1() #0 { >>> entry: >>> ret void >>> } >>> >>> But we turn globalfunc1 into available_externally in renameModuleForThinLTO(), which make the al...