Add examples for presentation
This commit is contained in:
parent
abd0defb17
commit
e17724b504
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.~lock.*.pptx#
|
10
presentation/Makefile
Normal file
10
presentation/Makefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
SRC=example.c
|
||||||
|
CC=gcc
|
||||||
|
|
||||||
|
build: nopie pie
|
||||||
|
|
||||||
|
nopie:
|
||||||
|
$(CC) -no-pie -o example.nopie example.c
|
||||||
|
|
||||||
|
pie:
|
||||||
|
$(CC) -pie -o example.pie example.c
|
11
presentation/example.c
Normal file
11
presentation/example.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include<stdio.h>
|
||||||
|
|
||||||
|
void some_function() {
|
||||||
|
puts("Hello, world!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
void (*function)() = &some_function;
|
||||||
|
printf("some_function is located at %p\n", function);
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
presentation/example.nopie
Executable file
BIN
presentation/example.nopie
Executable file
Binary file not shown.
BIN
presentation/example.pie
Executable file
BIN
presentation/example.pie
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user