Browse Source

Silence warnings in the `file` utility

Přemysl Janouch 2 years ago
parent
commit
cf6c1e67ba
Signed by: Přemysl Janouch <p.janouch@gmail.com> GPG Key ID: B715679E3A361BE6
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      bfc-amd64-linux.c

+ 4
- 3
bfc-amd64-linux.c View File

@@ -677,6 +677,7 @@ main (int argc, char *argv[])
677 677
 	{
678 678
 		ELF_HEADER_SIZE = 64,           // size of the ELF header
679 679
 		ELF_PROGRAM_ENTRY_SIZE = 56,    // size of a program header
680
+		ELF_SECTION_ENTRY_SIZE = 64,    // size of a section header
680 681
 		ELF_META_SIZE = ELF_HEADER_SIZE + 2 * ELF_PROGRAM_ENTRY_SIZE
681 682
 	};
682 683
 
@@ -689,7 +690,7 @@ main (int argc, char *argv[])
689 690
 	DD (0)                              // no processor-specific flags
690 691
 	DW (ELF_HEADER_SIZE)                // ELF header size
691 692
 	DW (ELF_PROGRAM_ENTRY_SIZE) DW (2)  // program hdr tbl entry size, count
692
-	DW (0) DW (0)                       // section hdr tbl entry size, count
693
+	DW (ELF_SECTION_ENTRY_SIZE) DW (0)  // section hdr tbl entry size, count
693 694
 	DW (0)                              // no section index for strings
694 695
 
695 696
 	// Program header for code
@@ -698,8 +699,8 @@ main (int argc, char *argv[])
698 699
 	DQ (0)                              // offset within the file
699 700
 	DQ (ELF_LOAD_CODE)                  // address in virtual memory
700 701
 	DQ (ELF_LOAD_CODE)                  // address in physical memory
701
-	DQ (code.len + ELF_META_SIZE)       // length within the file
702
-	DQ (code.len + ELF_META_SIZE)       // length within memory
702
+	DQ (ELF_META_SIZE + code.len)       // length within the file
703
+	DQ (ELF_META_SIZE + code.len)       // length within memory
703 704
 	DQ (4096)                           // segment alignment
704 705
 
705 706
 	// Program header for the tape

Loading…
Cancel
Save