mirror of
https://github.com/Noratrieb/blog.git
synced 2026-01-14 20:35:02 +01:00
link lonk
This commit is contained in:
parent
d370bf2b2e
commit
a3db9d1b07
21 changed files with 325 additions and 0 deletions
4
helpers/elf-linkage/.gitignore
vendored
Normal file
4
helpers/elf-linkage/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
*.o
|
||||
*.a
|
||||
*.so
|
||||
a.out
|
||||
BIN
helpers/elf-linkage/animation/1.png
Normal file
BIN
helpers/elf-linkage/animation/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
17
helpers/elf-linkage/animation/1.txt
Normal file
17
helpers/elf-linkage/animation/1.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
|
||||
┌───┐ ┌───┐
|
||||
ld │a.o│ │b.o│
|
||||
└───┘ └───┘
|
||||
|
||||
┌───────────┐ ┌───────────┐
|
||||
│a.o │ │b.o │
|
||||
│defined: │ │defined: │
|
||||
│ myfunc │ │ dependency│
|
||||
│undefined: │ │ │
|
||||
│ dependency│ │ │
|
||||
└───────────┘ └───────────┘
|
||||
|
||||
symbols:
|
||||
|
||||
|
||||
BIN
helpers/elf-linkage/animation/2.png
Normal file
BIN
helpers/elf-linkage/animation/2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
17
helpers/elf-linkage/animation/2.txt
Normal file
17
helpers/elf-linkage/animation/2.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
│
|
||||
▼
|
||||
┌───┐ ┌───┐
|
||||
ld │a.o│ │b.o│
|
||||
└───┘ └───┘
|
||||
|
||||
┌───────────┐ ┌───────────┐
|
||||
│a.o │ │b.o │
|
||||
│defined: │ │defined: │
|
||||
│ myfunc │ │ dependency│
|
||||
│undefined: │ │ │
|
||||
│ dependency│ │ │
|
||||
└───────────┘ └───────────┘
|
||||
|
||||
symbols:
|
||||
|
||||
|
||||
BIN
helpers/elf-linkage/animation/3.png
Normal file
BIN
helpers/elf-linkage/animation/3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
17
helpers/elf-linkage/animation/3.txt
Normal file
17
helpers/elf-linkage/animation/3.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
│
|
||||
▼
|
||||
┌───┐ ┌───┐
|
||||
ld │a.o│ │b.o│
|
||||
└───┘ └───┘
|
||||
|
||||
┌───────────┐ ┌───────────┐
|
||||
│a.o │ │b.o │
|
||||
│defined: │ │defined: │
|
||||
│ myfunc │ │ dependency│
|
||||
│undefined: │ │ │
|
||||
│ dependency│ │ │
|
||||
└───────────┘ └───────────┘
|
||||
|
||||
symbols:
|
||||
myfunc defined in a.o
|
||||
dependency undefined
|
||||
BIN
helpers/elf-linkage/animation/4.png
Normal file
BIN
helpers/elf-linkage/animation/4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
17
helpers/elf-linkage/animation/4.txt
Normal file
17
helpers/elf-linkage/animation/4.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
│
|
||||
▼
|
||||
┌───┐ ┌───┐
|
||||
ld │a.o│ │b.o│
|
||||
└───┘ └───┘
|
||||
|
||||
┌───────────┐ ┌───────────┐
|
||||
│a.o │ │b.o │
|
||||
│defined: │ │defined: │
|
||||
│ myfunc │ │ dependency│
|
||||
│undefined: │ │ │
|
||||
│ dependency│ │ │
|
||||
└───────────┘ └───────────┘
|
||||
|
||||
symbols:
|
||||
myfunc defined in a.o
|
||||
dependency undefined
|
||||
BIN
helpers/elf-linkage/animation/5.png
Normal file
BIN
helpers/elf-linkage/animation/5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 138 KiB |
17
helpers/elf-linkage/animation/5.txt
Normal file
17
helpers/elf-linkage/animation/5.txt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
│
|
||||
▼
|
||||
┌───┐ ┌───┐
|
||||
ld │a.o│ │b.o│
|
||||
└───┘ └───┘
|
||||
|
||||
┌───────────┐ ┌───────────┐
|
||||
│a.o │ │b.o │
|
||||
│defined: │ │defined: │
|
||||
│ myfunc │ │ dependency│
|
||||
│undefined: │ │ │
|
||||
│ dependency│ │ │
|
||||
└───────────┘ └───────────┘
|
||||
|
||||
symbols:
|
||||
myfunc defined in a.o
|
||||
dependency defined in b.o
|
||||
3
helpers/elf-linkage/animation/create.sh
Normal file
3
helpers/elf-linkage/animation/create.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
ffmpeg -framerate 0.5 -i %d.png -plays 0 -f apng output.png
|
||||
BIN
helpers/elf-linkage/animation/output.png
Normal file
BIN
helpers/elf-linkage/animation/output.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
4
helpers/elf-linkage/testing/a.c
Normal file
4
helpers/elf-linkage/testing/a.c
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
void dependency();
|
||||
int main() {
|
||||
dependency();
|
||||
}
|
||||
1
helpers/elf-linkage/testing/b.c
Normal file
1
helpers/elf-linkage/testing/b.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
void dependency() {}
|
||||
16
helpers/elf-linkage/testing/multi/Makefile
Normal file
16
helpers/elf-linkage/testing/multi/Makefile
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
main: multia.c libmultib.a libmultic.a libmultib.so libmultic.so
|
||||
cc multia.c -L. -Bdynamic -lmultib -lmultic -fuse-ld=lld
|
||||
|
||||
libmultib.so: multib.c
|
||||
cc -fPIC multib.c -shared -o libmultib.so
|
||||
|
||||
libmultic.so: multic.c
|
||||
cc -fPIC multic.c -shared -o libmultic.so
|
||||
|
||||
libmultib.a: multib.c
|
||||
cc -c multib.c
|
||||
ar -rcs libmultib.a multib.o
|
||||
|
||||
libmultic.a: multic.c
|
||||
cc -c multic.c
|
||||
ar -rcs libmultic.a multic.o
|
||||
9
helpers/elf-linkage/testing/multi/multia.c
Normal file
9
helpers/elf-linkage/testing/multi/multia.c
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#include <stdio.h>
|
||||
void conflict();
|
||||
void usec();
|
||||
void useb();
|
||||
int main() {
|
||||
usec();
|
||||
useb();
|
||||
conflict();
|
||||
}
|
||||
6
helpers/elf-linkage/testing/multi/multib.c
Normal file
6
helpers/elf-linkage/testing/multi/multib.c
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include <stdio.h>
|
||||
__attribute__((weak))
|
||||
void conflict() {
|
||||
puts("b");
|
||||
}
|
||||
void useb(){}
|
||||
8
helpers/elf-linkage/testing/multi/multic.c
Normal file
8
helpers/elf-linkage/testing/multi/multic.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include <stdio.h>
|
||||
void conflict() {
|
||||
puts("C");
|
||||
|
||||
}
|
||||
|
||||
void usec(){
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue