aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/development/ld/Makefile
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2025-03-30 01:46:26 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2025-03-30 01:51:58 +0100
commitab04f8876eef5e9da79573368d440da067293c2e (patch)
tree287482f68f0ac49317adbb0f4b7c27c7f9e81cd4 /src/development/ld/Makefile
parent916b73bee95494c205ba67e4a50e6a525afc3a3c (diff)
downloadnotes-ab04f8876eef5e9da79573368d440da067293c2e.tar.gz
notes-ab04f8876eef5e9da79573368d440da067293c2e.zip
ld: linker script example
Diffstat (limited to 'src/development/ld/Makefile')
-rw-r--r--src/development/ld/Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/development/ld/Makefile b/src/development/ld/Makefile
new file mode 100644
index 0000000..16869a8
--- /dev/null
+++ b/src/development/ld/Makefile
@@ -0,0 +1,15 @@
+show-mem:
+show-nomem:
+show-%: link-%
+ readelf -W -S -l $^
+ nm $^
+ objdump -d $^
+
+link-%: link-%.ld data.o
+ ld -o $@ -T $^
+
+%.o: %.S
+ gcc -c $^
+
+clean:
+ $(RM) mem *.o