This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
$ cat foo.c int foo(void) { return 42; } $ cat bar.c #include <stdio.h> extern int foo_alias(void); int main() { printf("%d\n",foo_alias()); } $ cat alias_table foo foo_alias $ gcc -c foo.c bar.c $ gcc -o foo foo.o bar.o _SOME_MAGIC_HERE_ $ ./foo 42 ... without changing foo.c or bar.c.
Is that possible?
% cat alias_table.s .global foo_alias foo_alias: jmp foo
% gcc foo.c bar.c alias_table.s % ./a.out 42
Cheers Nick
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |