๐Ÿ“ฆ cloudflare / cloudflare-blog

๐Ÿ“„ README.md ยท 24 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24# Example on how to import code from an object file without linking

1. Compile, but not link `obj.c`:

```bash
$ gcc -c obj.c
```

2. Compile and link `loader.c`:

```bash
$ gcc -o loader loader.c
```

3. Execute `loader` (`obj.o` has to be present in the same directory):

```bash
$ ./loader 
Executing add5...
add5(42) = 47
Executing add10...
add10(42) = 52
```