Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
Event Timeline
Comment Actions
$ cat > a.s << EOF > .globl foo,__wrap_foo,__real_foo > foo = 0x10 > __wrap_foo = 0x20 > __real_foo = 0x30 > EOF $ llvm-mc -filetype=obj -triple=x86_64-pc-linux a.s -o a.o $ ld -shared a.o -o ld.out -wrap=foo $ lld -flavor gnu2 -shared a.o -o lld.out -wrap=foo $ readelf -s ld.out | fgrep "foo" 1: 0000000000000030 0 NOTYPE GLOBAL DEFAULT ABS __real_foo 3: 0000000000000020 0 NOTYPE GLOBAL DEFAULT ABS __wrap_foo 4: 0000000000000010 0 NOTYPE GLOBAL DEFAULT ABS foo 8: 0000000000000030 0 NOTYPE GLOBAL DEFAULT ABS __real_foo 10: 0000000000000020 0 NOTYPE GLOBAL DEFAULT ABS __wrap_foo 11: 0000000000000010 0 NOTYPE GLOBAL DEFAULT ABS foo $ readelf -s lld.out | fgrep "foo" 1: 0000000000000010 0 NOTYPE LOCAL HIDDEN ABS __real_foo 2: 0000000000000020 0 NOTYPE LOCAL HIDDEN ABS __wrap_foo 3: 0000000000000020 0 NOTYPE LOCAL HIDDEN ABS foo
Comment Actions
$ cat > wrap.s << EOF > .globl __wrap_foo > __wrap_foo: > ret > EOF $ cat > main.s << EOF > .globl _start > _start: > call foo > EOF $ llvm-mc -filetype=obj -triple=x86_64-pc-linux -o wrap.o wrap.s $ llvm-mc -filetype=obj -triple=x86_64-pc-linux -o main.o main.s $ ld -o ld.out main.o wrap.o -wrap=foo $ lld -flavor gnu2 -o lld.out main.o wrap.o -wrap=foo undefined symbol: foo in main.o