Last active
February 9, 2022 16:49
-
-
Save nbdd0121/0f0bae5f4e3e2b3b8695f51eee523f19 to your computer and use it in GitHub Desktop.
Archive member selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
__attribute__((constructor)) | |
void a(void) { | |
printf("A\n"); | |
} | |
void aa(void) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
__attribute__((constructor)) | |
void b(void) { | |
printf("B\n"); | |
} | |
void bb(void) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void aa(void); | |
void bb(void); | |
int main(void) { | |
aa(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run: main | |
./main | |
a.o: a.c | |
gcc $^ -c -o $@ | |
b.o: b.c | |
gcc $^ -c -o $@ | |
foo.a: a.o b.o | |
ar cr $@ $^ | |
main: main.c foo.a | |
gcc $^ -o $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment