From be49d342e2e802f46259feaac3218a49a9d91ba5 Mon Sep 17 00:00:00 2001 From: Stefan Krulj Date: Thu, 28 Jun 2012 14:11:11 +0200 Subject: [PATCH] GCC garbage collection enabled, not tested --- Makefile | 13 ++++++++----- sha1.c | 4 ++-- test.c | 4 +--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 912e12e..5f1afe8 100644 --- a/Makefile +++ b/Makefile @@ -67,13 +67,16 @@ CFLAGS=-I. $(INC) -g -mmcu=$(MCU) -O$(OPTLEVEL) \ -fno-inline-functions \ -fno-inline-small-functions \ -fno-split-wide-types \ - -fpack-struct -fshort-enums \ - -funsigned-bitfields -funsigned-char \ + -fpack-struct \ + -fshort-enums \ + -funsigned-bitfields \ + -funsigned-char \ -Wall -Wstrict-prototypes \ + -Wl,--gc-sections \ + -Wl,--print-gc-sections \ + -ffunction-sections -fdata-sections \ -Wa,-ahlms=$(firstword \ - --gc-sections \ - --print-gc-sections \ - $(filter %.lst, $(<:.c=.lst))) + $(filter %.lst, $(<:.c=.lst))) ASMFLAGS =-I. $(INC) -mmcu=$(MCU) \ -x assembler-with-cpp \ -DF_CPU=16500000 \ diff --git a/sha1.c b/sha1.c index a6aacf7..dd61410 100644 --- a/sha1.c +++ b/sha1.c @@ -103,7 +103,7 @@ void sha1_fill(int32_t len){ } } -/*void sha1(char* msg, int32_t len){ +void sha1(char* msg, int32_t len){ int32_t i; uint8_t j; sha1_init(); @@ -120,7 +120,7 @@ void sha1_fill(int32_t len){ sha1_addbyte(msg[i+j]); } } -}*/ +} void sha1_init(void){ chunk_cnt=0; diff --git a/test.c b/test.c index 9f04214..6a4f695 100644 --- a/test.c +++ b/test.c @@ -62,7 +62,5 @@ int main(){ hmac(MSG2,8,sec,20); SHA1STR(); printf("HMAC: %s\n",sha1sum); - //assert(strcmp("b617318655057264e28bc0b6fb378c8ef146be00",sha1sum)==0); - - + //assert(strcmp("b617318655057264e28bc0b6fb378c8ef146be00",sha1sum)==0); }