mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-22 23:24:22 +08:00
Simplify firmware image generation and preserve original sections
This commit is contained in:
parent
e17ff8260f
commit
359ca554c0
2 changed files with 4 additions and 19 deletions
|
@ -210,14 +210,6 @@ $(OBJDIR)/fullimage.stage1.elf: $(VERSIONOBJ) $(OBJDIR)/fpga_all.o $(THUMBOBJ) $
|
|||
$(info [=] LD $@)
|
||||
$(Q)$(CROSS_LD) $(CROSS_LDFLAGS) -Wl,-T,ldscript,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
|
||||
|
||||
$(OBJDIR)/fullimage.nodata.bin: $(OBJDIR)/fullimage.stage1.elf
|
||||
$(info [-] GEN $@)
|
||||
$(Q)$(CROSS_OBJCOPY) -O binary -I elf32-littlearm --remove-section .data $^ $@
|
||||
|
||||
$(OBJDIR)/fullimage.nodata.o: $(OBJDIR)/fullimage.nodata.bin
|
||||
$(info [-] GEN $@)
|
||||
$(Q)$(CROSS_OBJCOPY) -O elf32-littlearm -I binary -B arm --rename-section .data=stage1_image $^ $@
|
||||
|
||||
$(OBJDIR)/fullimage.data.bin: $(OBJDIR)/fullimage.stage1.elf
|
||||
$(info [-] GEN $@)
|
||||
$(Q)$(CROSS_OBJCOPY) -O binary -I elf32-littlearm --only-section .data $^ $@
|
||||
|
@ -230,14 +222,10 @@ else
|
|||
$(FPGA_COMPRESSOR) $(filter %.bin,$^) $@
|
||||
endif
|
||||
|
||||
$(OBJDIR)/fullimage.data.o: $(OBJDIR)/fullimage.data.bin.z
|
||||
$(info [-] GEN $@)
|
||||
$(Q)$(CROSS_OBJCOPY) -O elf32-littlearm -I binary -B arm --rename-section .data=compressed_data $^ $@
|
||||
|
||||
$(OBJDIR)/fullimage.elf: $(OBJDIR)/fullimage.nodata.o $(OBJDIR)/fullimage.data.o
|
||||
$(OBJDIR)/fullimage.elf: $(OBJDIR)/fullimage.stage1.elf $(OBJDIR)/fullimage.data.bin.z
|
||||
ifeq (,$(findstring WITH_NO_COMPRESSION,$(APP_CFLAGS)))
|
||||
$(info [=] LD $@)
|
||||
$(Q)$(CROSS_LD) $(CROSS_LDFLAGS) -Wl,-T,ldscript,-e,_osimage_entry,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^
|
||||
$(Q)$(CROSS_OBJCOPY) -O elf32-littlearm -I elf32-littlearm --strip-all --update-section .data=$(OBJDIR)/fullimage.data.bin.z $(OBJDIR)/fullimage.stage1.elf $@
|
||||
else
|
||||
$(Q)$(CP) $(OBJDIR)/fullimage.stage1.elf $@
|
||||
endif
|
||||
|
|
|
@ -24,7 +24,6 @@ SECTIONS
|
|||
} >osimage :text
|
||||
|
||||
.text : {
|
||||
KEEP(*(stage1_image))
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.eh_frame)
|
||||
|
@ -36,12 +35,10 @@ SECTIONS
|
|||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
*(fpga_all_bit.data)
|
||||
KEEP(*(.version_information))
|
||||
. = ALIGN(8);
|
||||
} >osimage :text
|
||||
|
||||
.data : {
|
||||
KEEP(*(compressed_data))
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
*(.ramfunc)
|
||||
|
|
Loading…
Reference in a new issue