]> Shamusworld >> Repos - rmac/commitdiff
Added a few more fixes piggybacked on the last one; bump to v1.8.6.
authorShamus Hammons <jlhamm@acm.org>
Tue, 29 Aug 2017 18:28:18 +0000 (13:28 -0500)
committerShamus Hammons <jlhamm@acm.org>
Tue, 29 Aug 2017 18:28:18 +0000 (13:28 -0500)
mark.c
object.c
sect.h
version.h

diff --git a/mark.c b/mark.c
index 664e318f5790e53eddd7103597a774eebcba4750..7495c71c1eeecf571b26b7031dba32ae97495495 100644 (file)
--- 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;
                        }
index 7fd8fcce06ed190924fd0c175ff970f5322764e2..9294abefa8ed3431323b1e80f839f60ba912ce7a 100644 (file)
--- 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 b7e73af7c1ac13f857b0707f42fdcc45b55aa22f..3cfbf6acee00501820814fbbe328e1d8f2ee264b 100644 (file)
--- 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); \
                                                *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;}
index 9db74724eeb676a5a11507ab922983bd878caeb6..d5f4427d29478dba2a152b62f5982111d6d208f9 100644 (file)
--- 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__