-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Introduce elf_relocations A relocations table fleshed out. Not 100% sure how I want to leverage it but the markings of the table are there. * Ignore object files from examples directory * Added object relocations example * Bumped lief and pyright * removed redundant cast when bumped to 0.14.1 for LIEF
- Loading branch information
Showing
7 changed files
with
114 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ sqlelf.egg-info/ | |
dist/ | ||
result | ||
examples/**/exe | ||
examples/**/*.o | ||
examples/**/*.so | ||
venv/ | ||
temp/ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Variables | ||
CC = gcc | ||
CFLAGS = -Wall -g | ||
TARGET = exe | ||
|
||
# Default rule | ||
all: $(TARGET) | ||
|
||
$(TARGET): main.c sum.o | ||
$(CC) $(CFLAGS) -o $(TARGET) main.c sum.o | ||
|
||
sum.o: sum.c sum.h | ||
$(CC) $(CFLAGS) -c sum.c | ||
|
||
|
||
.PHONY: clean | ||
clean: | ||
rm -f $(TARGET) sum.o |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <stdio.h> | ||
|
||
#include "sum.h" | ||
|
||
int array[4] = {1, 2, 3, 4}; | ||
|
||
int main() { | ||
int val = sum(array, 4); | ||
printf("Sum: %d\n", val); | ||
return 0; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
|
||
int sum(const int* array, int size) { | ||
int sum = 0; | ||
for (int i = 0; i < size; i++) { | ||
sum += array[i]; | ||
} | ||
return sum; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
|
||
int sum(const int* array, int size); |
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
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