Skip to content

Commit

Permalink
Merge pull request #39 from kkebo/map-file
Browse files Browse the repository at this point in the history
chore: generate a map file
  • Loading branch information
kkebo authored Nov 24, 2024
2 parents 04877cb + d2e21b3 commit a988390
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.o
*.elf
*.img
*.map

.DS_Store
/.build
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EXE := kernel.elf
IMG := kernel8.img
MAP := kernel.map

TRIPLE := aarch64-none-none-elf
SWIFT := swift
Expand All @@ -14,7 +15,7 @@ QEMU := qemu-system-aarch64
all: $(IMG)

$(EXE): linker.ld swift
$(LD) $(LDFLAGS) -T linker.ld .build/release/libKernel.a -o $@
$(LD) $(LDFLAGS) -T linker.ld -Xlinker -Map=$(MAP) .build/release/libKernel.a -o $@

$(IMG): $(EXE)
$(OBJCOPY) $< -O binary $@
Expand All @@ -29,5 +30,5 @@ run: all

.PHONY: clean
clean:
$(RM) $(EXE) $(IMG)
$(RM) $(EXE) $(IMG) $(MAP)
$(SWIFT) package clean

0 comments on commit a988390

Please sign in to comment.