search for: __wrap_myfn

Displaying 4 results from an estimated 4 matches for "__wrap_myfn".

Did you mean: __wrap_fn
2013 Sep 13
2
[LLVMdev] [lld] Implementing the aliasing feature
...c seen at build time from libc, and all references to malloc will bind to it. Adding alternate names won’t stop that binding. Yes, thats how ld is behaving, if I have the the function in my .o's, it doesnot override. For example :- #include <stdio.h> int myfn() { return 0; } void __wrap_myfn() { printf("Hello World\n"); } int main() { myfn(); return 0; } $gcc wrap.c -Wl,--wrap,fn $./a.out $ Thanks Shankar Easwaran -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation -------------- next part -------------- An HTML...
2013 Sep 14
0
[LLVMdev] [lld] Implementing the aliasing feature
...malloc will bind to it. Adding alternate names won’t stop that binding. > Yes, thats how ld is behaving, if I have the the function in my .o's, it doesnot override. > > For example :- > > #include <stdio.h> > > int myfn() { > return 0; > } > > void __wrap_myfn() > { > printf("Hello World\n"); > } > > int main() { > myfn(); > return 0; > } > $gcc wrap.c -Wl,--wrap,fn > $./a.out > $ > > Thanks > > Shankar Easwaran > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora...
2013 Sep 13
0
[LLVMdev] [lld] Implementing the aliasing feature
On Sep 13, 2013, at 3:35 PM, Shankar Easwaran <shankare at codeaurora.org> wrote: > This would work only if an alias is another name for the same symbol(weak symbols). I don’t know what that means. Can you clarify? > > If what is being aliased is another function definition, which is a non zero sized atom, aliasing will not work. That is the exact scenario I think it *will* work
2013 Sep 13
2
[LLVMdev] [lld] Implementing the aliasing feature
Hi Nick, This would work only if an alias is another name for the same symbol(weak symbols). If what is being aliased is another function definition, which is a non zero sized atom, aliasing will not work. I was thinking to model this for ELF for the below functionalities :- a) __wrap For example : --wrap fn What I plan to do here is, create a undefined function fn atom create a defined