mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07: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 $@)
|
$(info [=] LD $@)
|
||||||
$(Q)$(CROSS_LD) $(CROSS_LDFLAGS) -Wl,-T,ldscript,-Map,$(patsubst %.elf,%.map,$@) -o $@ $^ $(LIBS)
|
$(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
|
$(OBJDIR)/fullimage.data.bin: $(OBJDIR)/fullimage.stage1.elf
|
||||||
$(info [-] GEN $@)
|
$(info [-] GEN $@)
|
||||||
$(Q)$(CROSS_OBJCOPY) -O binary -I elf32-littlearm --only-section .data $^ $@
|
$(Q)$(CROSS_OBJCOPY) -O binary -I elf32-littlearm --only-section .data $^ $@
|
||||||
|
@ -230,14 +222,10 @@ else
|
||||||
$(FPGA_COMPRESSOR) $(filter %.bin,$^) $@
|
$(FPGA_COMPRESSOR) $(filter %.bin,$^) $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(OBJDIR)/fullimage.data.o: $(OBJDIR)/fullimage.data.bin.z
|
$(OBJDIR)/fullimage.elf: $(OBJDIR)/fullimage.stage1.elf $(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
|
|
||||||
ifeq (,$(findstring WITH_NO_COMPRESSION,$(APP_CFLAGS)))
|
ifeq (,$(findstring WITH_NO_COMPRESSION,$(APP_CFLAGS)))
|
||||||
$(info [=] LD $@)
|
$(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
|
else
|
||||||
$(Q)$(CP) $(OBJDIR)/fullimage.stage1.elf $@
|
$(Q)$(CP) $(OBJDIR)/fullimage.stage1.elf $@
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -24,7 +24,6 @@ SECTIONS
|
||||||
} >osimage :text
|
} >osimage :text
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
KEEP(*(stage1_image))
|
|
||||||
*(.text)
|
*(.text)
|
||||||
*(.text.*)
|
*(.text.*)
|
||||||
*(.eh_frame)
|
*(.eh_frame)
|
||||||
|
@ -36,12 +35,10 @@ SECTIONS
|
||||||
*(.rodata)
|
*(.rodata)
|
||||||
*(.rodata.*)
|
*(.rodata.*)
|
||||||
*(fpga_all_bit.data)
|
*(fpga_all_bit.data)
|
||||||
KEEP(*(.version_information))
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
} >osimage :text
|
} >osimage :text
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
KEEP(*(compressed_data))
|
|
||||||
*(.data)
|
*(.data)
|
||||||
*(.data.*)
|
*(.data.*)
|
||||||
*(.ramfunc)
|
*(.ramfunc)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue