aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-12-24 01:23:22 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-12-24 22:29:29 +0100
commitcf6c1e67ba52943a9823018416cbc505962e85de (patch)
treec0095b6e653c532579bf060282150d2287576b07
parent290e7087bbbcccdffe8e31b038232a21026fbe41 (diff)
downloadbfc-cf6c1e67ba52943a9823018416cbc505962e85de.tar.gz
bfc-cf6c1e67ba52943a9823018416cbc505962e85de.tar.xz
bfc-cf6c1e67ba52943a9823018416cbc505962e85de.zip
Silence warnings in the `file` utility
-rw-r--r--bfc-amd64-linux.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bfc-amd64-linux.c b/bfc-amd64-linux.c
index 592c3ab..1579681 100644
--- a/bfc-amd64-linux.c
+++ b/bfc-amd64-linux.c
@@ -677,6 +677,7 @@ main (int argc, char *argv[])
{
ELF_HEADER_SIZE = 64, // size of the ELF header
ELF_PROGRAM_ENTRY_SIZE = 56, // size of a program header
+ ELF_SECTION_ENTRY_SIZE = 64, // size of a section header
ELF_META_SIZE = ELF_HEADER_SIZE + 2 * ELF_PROGRAM_ENTRY_SIZE
};
@@ -689,7 +690,7 @@ main (int argc, char *argv[])
DD (0) // no processor-specific flags
DW (ELF_HEADER_SIZE) // ELF header size
DW (ELF_PROGRAM_ENTRY_SIZE) DW (2) // program hdr tbl entry size, count
- DW (0) DW (0) // section hdr tbl entry size, count
+ DW (ELF_SECTION_ENTRY_SIZE) DW (0) // section hdr tbl entry size, count
DW (0) // no section index for strings
// Program header for code
@@ -698,8 +699,8 @@ main (int argc, char *argv[])
DQ (0) // offset within the file
DQ (ELF_LOAD_CODE) // address in virtual memory
DQ (ELF_LOAD_CODE) // address in physical memory
- DQ (code.len + ELF_META_SIZE) // length within the file
- DQ (code.len + ELF_META_SIZE) // length within memory
+ DQ (ELF_META_SIZE + code.len) // length within the file
+ DQ (ELF_META_SIZE + code.len) // length within memory
DQ (4096) // segment alignment
// Program header for the tape