link lonk

This commit is contained in:
nora 2025-06-09 22:20:23 +02:00
parent d370bf2b2e
commit a3db9d1b07
21 changed files with 325 additions and 0 deletions

4
helpers/elf-linkage/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
*.o
*.a
*.so
a.out

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

View file

@ -0,0 +1,17 @@
┌───┐ ┌───┐
ld │a.o│ │b.o│
└───┘ └───┘
┌───────────┐ ┌───────────┐
│a.o │ │b.o │
│defined: │ │defined: │
│ myfunc │ │ dependency│
│undefined: │ │ │
│ dependency│ │ │
└───────────┘ └───────────┘
symbols:

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

View file

@ -0,0 +1,17 @@
┌───┐ ┌───┐
ld │a.o│ │b.o│
└───┘ └───┘
┌───────────┐ ┌───────────┐
│a.o │ │b.o │
│defined: │ │defined: │
│ myfunc │ │ dependency│
│undefined: │ │ │
│ dependency│ │ │
└───────────┘ └───────────┘
symbols:

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

View 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

View 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

View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
ffmpeg -framerate 0.5 -i %d.png -plays 0 -f apng output.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -0,0 +1,4 @@
void dependency();
int main() {
dependency();
}

View file

@ -0,0 +1 @@
void dependency() {}

View 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

View file

@ -0,0 +1,9 @@
#include <stdio.h>
void conflict();
void usec();
void useb();
int main() {
usec();
useb();
conflict();
}

View file

@ -0,0 +1,6 @@
#include <stdio.h>
__attribute__((weak))
void conflict() {
puts("b");
}
void useb(){}

View file

@ -0,0 +1,8 @@
#include <stdio.h>
void conflict() {
puts("C");
}
void usec(){
}