From d1f5f1caccb26da6a3da7fc00b94b79000a55302 Mon Sep 17 00:00:00 2001 From: Shamus Hammons Date: Tue, 29 Aug 2017 13:28:18 -0500 Subject: [PATCH] Added a few more fixes piggybacked on the last one; bump to v1.8.6. --- mark.c | 2 +- object.c | 2 ++ sect.h | 6 +----- version.h | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mark.c b/mark.c index 664e318..7495c71 100644 --- a/mark.c +++ b/mark.c @@ -528,7 +528,7 @@ uint32_t CreateELFRelocationRecord(uint8_t * buf, uint8_t * secBuf, uint16_t sec // Deposit the relocation record D_long(r_offset); - D_long((r_sym << 8) | r_type); + D_long(((r_sym << 8) | r_type)); D_long(r_addend); rsize += 0x0C; } diff --git a/object.c b/object.c index 7fd8fcc..9294abe 100644 --- a/object.c +++ b/object.c @@ -229,6 +229,7 @@ uint8_t * AddELFSymEntry(uint8_t * buf, SYM * sym, int globflag) int DepositELFSectionHeader(uint8_t * ptr, uint32_t name, uint32_t type, uint32_t flags, uint32_t addr, uint32_t offset, uint32_t size, uint32_t link, uint32_t info, uint32_t addralign, uint32_t entsize) { chptr = ptr; + ch_size = 0; D_long(name); D_long(type); D_long(flags); @@ -264,6 +265,7 @@ printf("DepositELFSHSTEntry: s = \"%s\"\n", s); uint32_t DepositELFSymbol(uint8_t * ptr, uint32_t name, uint32_t addr, uint32_t size, uint8_t info, uint8_t other, uint16_t shndx) { chptr = ptr; + ch_size = 0; D_long(name); D_long(addr); D_long(size); diff --git a/sect.h b/sect.h index b7e73af..3cfbf6a 100644 --- a/sect.h +++ b/sect.h @@ -13,7 +13,6 @@ // Macros to deposit code in the current section // D_rword deposits a "6502" format (low, high) word (01). -// D_rlong deposits a MWC "canonical byte order" longword (2301). #define D_byte(b) {*chptr++=(uint8_t)(b); sloc++; ch_size++; \ if(orgactive) orgaddr++;} #define D_word(w) {chcheck(2);*chptr++=(uint8_t)((w)>>8); \ @@ -24,11 +23,8 @@ *chptr++=(uint8_t)((lw)>>8); \ *chptr++=(uint8_t)(lw); \ sloc += 4; ch_size += 4; if(orgactive) orgaddr += 4;} -#define D_rword(w) {*chptr++=(uint8_t)w; *chptr++=(uint8_t)(w>>8); \ +#define D_rword(w) {*chptr++=(uint8_t)(w); *chptr++=(uint8_t)((w)>>8); \ sloc+=2; ch_size+=2;if(orgactive) orgaddr += 2;} -//#define D_rlong(lw) {*chptr++=(uint8_t)(lw>>16);*chptr++=(uint8_t)(lw>>24);\ -// *chptr++=(uint8_t)lw;*chptr++=(uint8_t)(lw>>8); \ -// sloc+=4; ch_size += 4;if(orgactive) orgaddr += 4;} // Fill n bytes with zeroes #define D_ZEROFILL(n) {memset(chptr, 0, n); chptr+=n; sloc+=n; ch_size+=n;\ if (orgactive) orgaddr+=n;} diff --git a/version.h b/version.h index 9db7472..d5f4427 100644 --- a/version.h +++ b/version.h @@ -15,7 +15,7 @@ #define MAJOR 1 // Major version number #define MINOR 8 // Minor version number -#define PATCH 5 // Patch release number +#define PATCH 6 // Patch release number #endif // __VERSION_H__ -- 2.37.2