[Cryptech-Commits] [user/ln5/stm32-avalanche-noise] 05/05: Revert "Add version and application info to ELF file"

git at cryptech.is git at cryptech.is
Sun Jan 26 09:37:11 UTC 2020


This is an automated email from the git hooks/post-receive script.

linus at nordberg.se pushed a commit to branch master
in repository user/ln5/stm32-avalanche-noise.

commit be1d685c0d9d5535c181d0ab7220f621609abde4
Author: Linus Nordberg <linus at nordberg.se>
AuthorDate: Thu Jan 23 13:23:53 2020 +0100

    Revert "Add version and application info to ELF file"
    
    Adding symbols to an ELF file doesn't solve the problem we're trying
    to solve. We want to be able to identify which application is running
    on a board when we don't know what ELF file has been loaded in flash.
    
    A checksum over the contens of the flash memory seems less dumb.
    
    This reverts commit 49d39287252bf0bd2b3fd75e86d07616b56c7fd2.
---
 src/cc20rng/Makefile | 18 +-----------------
 src/entropy/Makefile | 18 +-----------------
 2 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/src/cc20rng/Makefile b/src/cc20rng/Makefile
index bc5fce5..debf547 100644
--- a/src/cc20rng/Makefile
+++ b/src/cc20rng/Makefile
@@ -1,19 +1,3 @@
-# Application number and version info are included in the ELF file
-# symbol table through two global, asbolute symbols. Use nm(1) on an
-# ELF file to figure things out. Example:
-#   nm cc20rng.elf | awk '/VERSION/{print $1}'
-
-# Application number:
-# - cc20rng: 01
-# - entropy: 02
-APPLICATION = 0x00000001
-
-# Version info is four octects, from most significant to least:
-# - Major version, two bytes: 00..FFFF
-# - Minor version, one byte: 00..FF
-# - Patch level, one byte: 00..FF
-VERSION = 0x00010000
-
 # put your *.o targets here, make should handle the rest!
 SRCS = main.c stm_init.c system_stm32f4xx.c stm32f4xx_it.c stm32f4xx_hal_msp.c cc20_prng.c
 
@@ -39,7 +23,7 @@ lib:
 proj: 	$(PROJ_NAME).elf
 
 $(PROJ_NAME).elf: $(SRCS)
-	$(CC) $(CFLAGS) $^ -o $@ -L$(STD_PERIPH_LIB) -lstmf4 -L$(LDSCRIPT_INC) -T$(MCU_LINKSCRIPT) -g -Wl,--defsym=APPLICATION=$(APPLICATION) -Wl,--defsym=VERSION=$(VERSION)
+	$(CC) $(CFLAGS) $^ -o $@ -L$(STD_PERIPH_LIB) -lstmf4 -L$(LDSCRIPT_INC) -T$(MCU_LINKSCRIPT) -g
 	$(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex
 	$(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin
 	$(OBJDUMP) -St $(PROJ_NAME).elf >$(PROJ_NAME).lst
diff --git a/src/entropy/Makefile b/src/entropy/Makefile
index 0285460..68723b8 100644
--- a/src/entropy/Makefile
+++ b/src/entropy/Makefile
@@ -1,19 +1,3 @@
-# Application number and version info are included in the ELF file
-# symbol table through two global, asbolute symbols. Use nm(1) on an
-# ELF file to figure things out. Example:
-#   nm entropy.elf | awk '/VERSION/{print $1}'
-
-# Application number:
-# - cc20rng: 01
-# - entropy: 02
-APPLICATION = 0x00000002
-
-# Version info is four octects, from most significant to least:
-# - Major version, two bytes: 00..FFFF
-# - Minor version, one byte: 00..FF
-# - Patch level, one byte: 00..FF
-VERSION = 0x00010000
-
 # put your *.o targets here, make should handle the rest!
 SRCS = main.c stm_init.c system_stm32f4xx.c stm32f4xx_it.c stm32f4xx_hal_msp.c
 
@@ -39,7 +23,7 @@ lib:
 proj: 	$(PROJ_NAME).elf
 
 $(PROJ_NAME).elf: $(SRCS)
-	$(CC) $(CFLAGS) $^ -o $@ -L$(STD_PERIPH_LIB) -lstmf4 -L$(LDSCRIPT_INC) -T$(MCU_LINKSCRIPT) -g -Wl,--defsym=APPLICATION=$(APPLICATION) -Wl,--defsym=VERSION=$(VERSION)
+	$(CC) $(CFLAGS) $^ -o $@ -L$(STD_PERIPH_LIB) -lstmf4 -L$(LDSCRIPT_INC) -T$(MCU_LINKSCRIPT) -g
 	$(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex
 	$(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin
 	$(OBJDUMP) -St $(PROJ_NAME).elf >$(PROJ_NAME).lst



More information about the Commits mailing list