4 # Add future prerequisites somewhere among the list of libraries.
5 # You really should not have to add anything in the $(LD) line.
7 boot_img.o: boot_img.x2 boot_img.ren_syms
9 $(VERBOSE)$(OBJCOPY) --redefine-syms=boot_img.ren_syms $< $@
11 boot_img.ren_syms: boot_img.x2
13 $(VERBOSE)$(NM) -u $^ | perl -n -e 'if (/^\s*U\s+bootstrap_(.*)$$/) { print "bootstrap_$$1 $$1\n"; }' > $@
15 boot_img.x1: $(OBJ_BOOT) $(DRIVERS) $(MINILIBC)
17 $(VERBOSE)$(LD) -m $(LD_EMULATION) -r -s -o $@ \
18 -T $(srcdir)/boot/amd64/bootstrap.ld $^ $(LIBGCC)
20 boot_img.x2: boot_img.x1
22 $(VERBOSE)$(OBJCOPY) --prefix-alloc-sections=.bootstrap --prefix-symbols=bootstrap_ -G bootstrap__boot_start $^ $@
26 kernel.amd64.lds: linking.h
28 $(KERNEL): kernel.amd64.lds boot_img.o $(CRT0) $(OBJ_KERNEL) $(JDB) $(LIBK) $(KERNEL_EXTRA_LIBS) $(ABI) $(JABI) libdrivers.a $(CXXLIB) $(LIBKERN) $(MINILIBC) libgluedriverslibc.a
30 $(VERBOSE)$(LD) -m elf_x86_64 -N -T $< -gc-sections \
31 -o $@ $(filter-out $<,$+) $(LIBGCC) $(KERNEL_UNRES_SYMS)
35 $(VERBOSE)$(STRIP) -o $@ $<
36 $(VERBOSE)chmod 755 $@
37 $(VERBOSE)ln -sf $@ fiasco