Bug fixes
authorRobert Pengelly <robertapengelly@hotmail.com>
Sun, 2 Nov 2025 07:45:09 +0000 (07:45 +0000)
committerRobert Pengelly <robertapengelly@hotmail.com>
Sun, 2 Nov 2025 07:45:09 +0000 (07:45 +0000)
Makefile.w32
ld.h
map.c
section.h

index 2068ae71b65a5becdd3c4c5317a10582bfe0a295..326d9dc59f7ff2d6ddbaa07e1a0d0b53dc3c4ed9 100644 (file)
@@ -5,8 +5,7 @@ SRCDIR              ?=  $(CURDIR)
 VPATH               :=  $(SRCDIR)
 
 CC                  :=  gcc
-CFLAGS              :=  -D_FILE_OFFSET_BITS=64 -O2 -Wall -Werror -Wextra -ansi -pedantic -std=c90
-
+CFLAGS              :=  -D_FILE_OFFSET_BITS=64 -O2 -Wall -Werror -Wextra
 CSRC                :=  aout.c coff.c elks.c hashtab.c ld.c lib.c link.c macho.c map.c mz.c omf.c pe.c report.c section.c symbol.c vector.c write7x.c
 
 all: slink.exe
diff --git a/ld.h b/ld.h
index 2d87d8dbbe22fd02bf6b2d8aaa23081a85d05917..7424685bfc48cbf64939dd4d94ac1838fbc9efd1 100644 (file)
--- a/ld.h
+++ b/ld.h
@@ -5,6 +5,7 @@
 #define     _LD_H
 
 #define     FAKE_LD_FILENAME            "autogenerated"
+#include    "stdint.h"
 
 struct ld_state {
 
@@ -12,10 +13,10 @@ struct ld_state {
     long nb_input_files;
     
     const char *entry_symbol_name;
-    unsigned long entry_point;
+    uint64_t entry_point;
     
     const char *output_map_filename;
-    unsigned long base_address;
+    uint64_t base_address;
     
     const char *output_filename;
     int create_shared_library, format;
diff --git a/map.c b/map.c
index 6f605e0c34e86ad703837acdf0daa708615cef50..f0ba5a1b8b05791379cbd4d9e5e424ce201dafa7 100644 (file)
--- a/map.c
+++ b/map.c
@@ -122,7 +122,7 @@ void map_write (const char *filename) {
     
     }
     
-    fprintf (fp, "Entry Point: 0x%08lx\n", state->base_address + state->entry_point);
+    fprintf (fp, "Entry Point: 0x%08"PRIx64"\n", state->base_address + state->entry_point);
     
     if (strcmp (filename, "") != 0) {
         fclose (fp);
index 42013264f7df8f591496e9e8c71a5d2bbb2d6a0e..e72e827af45bef0702d44e3cd29c65fd79c8a313 100644 (file)
--- a/section.h
+++ b/section.h
@@ -25,7 +25,7 @@ struct section_part {
     struct object_file *of;
     
     unsigned char *content;
-    unsigned long content_size, alignment;
+    uint64_t content_size, alignment;
     
     struct reloc_entry *reloc_arr;
     unsigned long reloc_cnt;