From b2227e6abd39a1d199c0c18cfde20d07b07d91b9 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Sun, 2 Nov 2025 07:45:09 +0000 Subject: [PATCH] Bug fixes --- Makefile.w32 | 3 +-- ld.h | 5 +++-- map.c | 2 +- section.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.w32 b/Makefile.w32 index 2068ae7..326d9dc 100644 --- a/Makefile.w32 +++ b/Makefile.w32 @@ -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 2d87d8d..7424685 100644 --- 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 6f605e0..f0ba5a1 100644 --- 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); diff --git a/section.h b/section.h index 4201326..e72e827 100644 --- 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; -- 2.34.1