Skip to content

Commit 4193665

Browse files
authored
Merge pull request #1 from staticfloat/sf/v2.53
2022-04-28 version 2.53
2 parents 4c8d47e + a9bfb83 commit 4193665

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+4802
-2827
lines changed

changelog.txt

Lines changed: 77 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,77 @@
1-
2017-07-27 version 2.47
2-
* fixed bug in library manager for long module names
3-
4-
2017-07-15 version 2.46
5-
* dump of ELF files improved
6-
* a new unnecessary warnings removed
7-
8-
2017-04-10 version 2.45
9-
* support disassembly of forthcoming Control-flow Enforcement instructions
10-
11-
2016-11-27 version 2.44
12-
* fixed bug when disassembling file generated by Tiny C compiler
13-
14-
2016-11-09 version 2.43
15-
* fixed "string table corrupt" message for ELF files
16-
* support for disassembly of AVX512_4VNNIW, AVX512_4FMAPS instructions
17-
18-
2016-01-16 version 2.42
19-
* fixed bugs with disassembly of some AVX512 and BMI2 instructions
20-
21-
2015-10-15 version 2.41
22-
* fixed bugs with disassembly of some AVX512 instructions
23-
* fixed missing "ptr" in masm syntax disassembly
24-
25-
2015-10-15 version 2.40
26-
* fixed bugs with disassembly of some AVX512 instructions
27-
28-
2015-09-14 version 2.39
29-
* fixed bugs with disassembly of some AVX512 instructions
30-
31-
2014-12-15 version 2.38
32-
* fixed bugs with disassembly of Knights Corner instruction set
33-
* exe file made compatible with Windows XP
34-
35-
2014-12-06 version 2.37
36-
* support for disassembly of AVX512BW/DQ, etc.
37-
* fixed disassembly bug of vpgatherdd on knights corner
38-
* fixed disassembly bug for FMA4 instructions
39-
* improved disassembly of switch/case tables for gcc and clang compilers
40-
41-
2014-07-21 version 2.36
42-
* improved execution times for disassembling very big files
43-
44-
2013-11-27 version 2.32
45-
* fix bug with .bss section in elf2elf.cpp and elf2coff.cpp
46-
47-
2013-08-23 version 2.31
48-
* support for disassembly of AVX512F
49-
* library operations were extremely slow on big libraries because of rebuilding and search for unique names. This problem is fixed.
50-
* long member names allowed in libraries
51-
* option -ls to make member names short. Perhaps good for compatibility with BSD. Member names are made unique just by adding a running hex number, not by comparing with all previous names, which was the cause of slow operations in previous versions.
52-
* option -ns to change symbol suffixes
53-
* options -ap and -as to change prefix or suffix and keep old name as alias
54-
* added missing relocation type in ELF to COFF conversion
55-
* fixed error that often occurred when disassembling .exe files
56-
* fixed minor errors
57-
58-
2012-08-31 version 2.16
59-
* support for disassembly of Knights Corner instruction set
1+
2022-04-28 version 2.53
2+
* add disassembler support for AVX512-FP16, etc.
3+
4+
2020-06-08 version 2.52
5+
* fix problem in asm syntax output for lea
6+
7+
2018-10-08 version 2.51
8+
* fix bug in movq mm0,rax
9+
10+
2018-08-15 version 2.50
11+
* minor change in omf2cof
12+
13+
2018-01-29 version 2.49
14+
* fixed minor problem with disassembly of DLL
15+
16+
2017-10-18 version 2.48
17+
* minor changes
18+
19+
2017-07-27 version 2.47
20+
* fixed bug in library manager for long module names
21+
22+
2017-07-15 version 2.46
23+
* dump of ELF files improved
24+
* a new unnecessary warnings removed
25+
26+
2017-04-10 version 2.45
27+
* support disassembly of forthcoming Control-flow Enforcement instructions
28+
29+
2016-11-27 version 2.44
30+
* fixed bug when disassembling file generated by Tiny C compiler
31+
32+
2016-11-09 version 2.43
33+
* fixed "string table corrupt" message for ELF files
34+
* support for disassembly of AVX512_4VNNIW, AVX512_4FMAPS instructions
35+
36+
2016-01-16 version 2.42
37+
* fixed bugs with disassembly of some AVX512 and BMI2 instructions
38+
39+
2015-10-15 version 2.41
40+
* fixed bugs with disassembly of some AVX512 instructions
41+
* fixed missing "ptr" in masm syntax disassembly
42+
43+
2015-10-15 version 2.40
44+
* fixed bugs with disassembly of some AVX512 instructions
45+
46+
2015-09-14 version 2.39
47+
* fixed bugs with disassembly of some AVX512 instructions
48+
49+
2014-12-15 version 2.38
50+
* fixed bugs with disassembly of Knights Corner instruction set
51+
* exe file made compatible with Windows XP
52+
53+
2014-12-06 version 2.37
54+
* support for disassembly of AVX512BW/DQ, etc.
55+
* fixed disassembly bug of vpgatherdd on knights corner
56+
* fixed disassembly bug for FMA4 instructions
57+
* improved disassembly of switch/case tables for gcc and clang compilers
58+
59+
2014-07-21 version 2.36
60+
* improved execution times for disassembling very big files
61+
62+
2013-11-27 version 2.32
63+
* fix bug with .bss section in elf2elf.cpp and elf2coff.cpp
64+
65+
2013-08-23 version 2.31
66+
* support for disassembly of AVX512F
67+
* library operations were extremely slow on big libraries because of rebuilding and search for unique names. This problem is fixed.
68+
* long member names allowed in libraries
69+
* option -ls to make member names short. Perhaps good for compatibility with BSD. Member names are made unique just by adding a running hex number, not by comparing with all previous names, which was the cause of slow operations in previous versions.
70+
* option -ns to change symbol suffixes
71+
* options -ap and -as to change prefix or suffix and keep old name as alias
72+
* added missing relocation type in ELF to COFF conversion
73+
* fixed error that often occurred when disassembling .exe files
74+
* fixed minor errors
75+
76+
2012-08-31 version 2.16
77+
* support for disassembly of Knights Corner instruction set

src/build.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Build script for building objconv on Linux, BSD and Mac OS X platforms.
4+
5+
# Instructions:
6+
7+
# You may need to change the path to bash above as required by your system
8+
9+
# Make sure the current directory contains all the .cpp files for objconv,
10+
# and only one copy of each, and no other .cpp files
11+
12+
# Then run ./build.sh
13+
# The compilation may take half a minute.
14+
15+
# Alternatively, run the following line:
16+
17+
g++ -o objconv -O2 *.cpp
18+
19+
#or: clang++ -o objconv -O2 *.cpp

src/cmdline.cpp

100644100755
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**************************** cmdline.cpp **********************************
22
* Author: Agner Fog
33
* Date created: 2006-07-25
4-
* Last modified: 2018-01-29
4+
* Last modified: 2022-04-28
55
* Project: objconv
66
* Module: cmdline.cpp
77
* Description:
88
* This module is for interpretation of command line options
99
* Also contains symbol change function
1010
*
11-
* Copyright 2006-2018 GNU General Public License http://www.gnu.org/licenses
11+
* Copyright 2006-2022 GNU General Public License http://www.gnu.org/licenses
1212
*****************************************************************************/
1313

1414
#include "stdafx.h"
@@ -39,14 +39,14 @@ static SIntTxt SubtypeNames[] = {
3939
{SUBTYPE_MASM, "asm"},
4040
{SUBTYPE_MASM, "masm"},
4141
{SUBTYPE_MASM, "tasm"},
42-
{SUBTYPE_YASM, "nasm"},
43-
{SUBTYPE_YASM, "yasm"},
42+
{SUBTYPE_NASM, "nasm"},
43+
{SUBTYPE_NASM, "yasm"},
4444
{SUBTYPE_GASM, "gasm"},
4545
{SUBTYPE_GASM, "gas"}
4646
};
4747

4848
// List of standard names that are always translated
49-
const uint32 MaxType = FILETYPE_MACHO_LE;
49+
const uint32_t MaxType = FILETYPE_MACHO_LE;
5050

5151
// Standard names in 32-bit mode
5252
const char * StandardNames32[][MaxType+1] = {
@@ -173,7 +173,7 @@ void CCommandLineInterpreter::ReadCommandFile(char * filename) {
173173
ResponseFiles[NumBuffers-1].Read();
174174

175175
// Get buffer with file contents
176-
char * buffer = ResponseFiles[NumBuffers-1].Buf();
176+
char * buffer = (char*)ResponseFiles[NumBuffers-1].Buf();
177177
char * ItemBegin, * ItemEnd; // Mark begin and end of token in buffer
178178

179179
// Check if buffer is allocated
@@ -183,13 +183,13 @@ void CCommandLineInterpreter::ReadCommandFile(char * filename) {
183183
while (*buffer) {
184184

185185
// Skip whitespace
186-
while (*buffer != 0 && uint8(*buffer) <= uint8(' ')) buffer++;
186+
while (*buffer != 0 && uint8_t(*buffer) <= uint8_t(' ')) buffer++;
187187
if (*buffer == 0) break; // End of buffer found
188188
ItemBegin = buffer;
189189

190190
// Find end of token
191191
ItemEnd = buffer+1;
192-
while (uint8(*ItemEnd) > uint8(' ')) ItemEnd++;
192+
while (uint8_t(*ItemEnd) > uint8_t(' ')) ItemEnd++;
193193
if (*ItemEnd == 0) {
194194
buffer = ItemEnd;
195195
}
@@ -436,8 +436,8 @@ void CCommandLineInterpreter::AddObjectToLibrary(char * filename, char * membern
436436
}
437437

438438
// Truncate name and store it in MemberNames
439-
//uint32 Name1Offset = MemberNames.PushString(CLibrary::TruncateMemberName(membername));
440-
uint32 Name1Offset = MemberNames.PushString(membername);
439+
//uint32_t Name1Offset = MemberNames.PushString(CLibrary::TruncateMemberName(membername));
440+
uint32_t Name1Offset = MemberNames.PushString(membername);
441441
Sym.Name1 = (char*)(MemberNames.Buf() + Name1Offset);
442442
CLibrary::StripMemberName(Sym.Name1);
443443

@@ -648,7 +648,7 @@ void CCommandLineInterpreter::InterpretSymbolNameChangeOption(char * string) {
648648
}
649649
if (name2 && name2[0]) {
650650
// name2 found. check if it ends with ':'
651-
for (uint32 i = 0; i < (uint32)strlen(name2); i++) {
651+
for (uint32_t i = 0; i < (uint32_t)strlen(name2); i++) {
652652
if (name2[i] == ':') name2[i] = 0;
653653
}
654654
}
@@ -787,7 +787,7 @@ void CCommandLineInterpreter::InterpretImagebaseOption(char * string) {
787787
// Must be divisible by page size
788788
err.submit(2331, string);
789789
}
790-
if ((int32)ImageBase <= 0) {
790+
if ((int32_t)ImageBase <= 0) {
791791
// Cannot be zero or > 2^31
792792
err.submit(2332, string);
793793
}
@@ -819,7 +819,7 @@ void CCommandLineInterpreter::CheckExtractSuccess() {
819819
// Check if library members to extract were found
820820

821821
// Search through SymbolList for extract records
822-
for (uint32 i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) {
822+
for (uint32_t i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) {
823823
SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + i);
824824
if (Sym->Action == SYMA_EXTRACT_MEMBER && Sym->Done == 0) {
825825
// Member has not been extracted
@@ -833,7 +833,7 @@ void CCommandLineInterpreter::CheckSymbolModifySuccess() {
833833
// Check if symbols to modify were found
834834

835835
// Search through SymbolList for symbol change records
836-
for (uint32 i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) {
836+
for (uint32_t i = 0; i < SymbolList.GetDataSize(); i += sizeof(SSymbolChange)) {
837837
SSymbolChange * Sym = (SSymbolChange *)(SymbolList.Buf() + i);
838838
if (Sym->Action >= SYMA_MAKE_WEAK && Sym->Action < SYMA_ADD_MEMBER && Sym->Done == 0) {
839839
// Member has not been extracted
@@ -869,7 +869,7 @@ int CCommandLineInterpreter::SymbolChange(char const * oldname, char const ** ne
869869

870870
// Convert standard names if type conversion
871871
if (cmd.InputType != cmd.OutputType
872-
&& uint32(cmd.InputType) <= MaxType && uint32(cmd.OutputType) <= MaxType) {
872+
&& uint32_t(cmd.InputType) <= MaxType && uint32_t(cmd.OutputType) <= MaxType) {
873873
if (DesiredWordSize == 32) {
874874
// Look for standard names to translate, 32-bit
875875
for (i = 0; i < NumStandardNames; i++) {
@@ -1053,7 +1053,7 @@ int CCommandLineInterpreter::SymbolChange(char const * oldname, char const ** ne
10531053
static char const * StandardSectionNames[] = {
10541054
".text", ".data", ".bss", ".comment", ".lib"
10551055
};
1056-
for (uint32 i = 0; i < sizeof(StandardSectionNames)/sizeof(StandardSectionNames[0]); i++) {
1056+
for (uint32_t i = 0; i < sizeof(StandardSectionNames)/sizeof(StandardSectionNames[0]); i++) {
10571057
if (stricmp(oldname,StandardSectionNames[i]) == 0) {
10581058
// Standard name. Don't change
10591059
return SYMA_NOCHANGE;
@@ -1186,7 +1186,7 @@ void CCommandLineInterpreter::ReportStatistics() {
11861186
void CCommandLineInterpreter::Help() {
11871187
// Print help message
11881188
printf("\nObject file converter version %.2f for x86 and x86-64 platforms.", OBJCONV_VERSION);
1189-
printf("\nCopyright (c) 2018 by Agner Fog. Gnu General Public License.");
1189+
printf("\nCopyright (c) 2022 by Agner Fog. Gnu General Public License.");
11901190
printf("\n\nUsage: objconv options inputfile [outputfile]");
11911191
printf("\n\nOptions:");
11921192
printf("\n-fXXX[SS] Output file format XXX, word size SS. Supported formats:");

src/cmdline.h

100644100755
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
// Constants for subtypes
2828
#define SUBTYPE_MASM 0 // Disassembly MASM/TASM
29-
#define SUBTYPE_YASM 1 // Disassembly NASM/YASM
29+
#define SUBTYPE_NASM 1 // Disassembly NASM/YASM
3030
#define SUBTYPE_GASM 2 // Disassembly GAS(Intel)
3131

3232
// Constants for verbose or silent console output
@@ -136,16 +136,16 @@ class CCommandLineInterpreter {
136136
int SubType; // Subtype of output type. Assembly language dialect or library type
137137
int MemberType; // File type of library members
138138
int DesiredWordSize; // Desired word size for output file
139-
uint32 Verbose; // How much diagnostics to print on screen
140-
uint32 DumpOptions; // Options for dumping file
141-
uint32 DebugInfo; // Strip or convert debug info
142-
uint32 ExeptionInfo; // Strip or preserve exception handler info and other incompatible info
143-
uint32 Underscore; // Add/remove underscores in symbol names
144-
uint32 SegmentDot; // Change underscore/dot in beginning of segment names
145-
uint32 LibraryOptions; // Options for manipulating library
146-
uint32 LibrarySubtype; // Options for manipulating library
147-
uint32 FileOptions; // Options for input and output files
148-
uint32 ImageBase; // Specified image base
139+
uint32_t Verbose; // How much diagnostics to print on screen
140+
uint32_t DumpOptions; // Options for dumping file
141+
uint32_t DebugInfo; // Strip or convert debug info
142+
uint32_t ExeptionInfo; // Strip or preserve exception handler info and other incompatible info
143+
uint32_t Underscore; // Add/remove underscores in symbol names
144+
uint32_t SegmentDot; // Change underscore/dot in beginning of segment names
145+
uint32_t LibraryOptions; // Options for manipulating library
146+
uint32_t LibrarySubtype; // Options for manipulating library
147+
uint32_t FileOptions; // Options for input and output files
148+
uint32_t ImageBase; // Specified image base
149149
int ShowHelp; // Help screen printed
150150
protected:
151151
int libmode; // -lib option has been encountered
@@ -169,8 +169,8 @@ class CCommandLineInterpreter {
169169
int SymbolChangeEntries; // Number of entries in SymbolList, except library entries
170170
CMemoryBuffer SymbolList; // List of symbol names to change. Contains entries of type SSymbolChange
171171
CMemoryBuffer MemberNames; // Buffer containing truncated member names
172-
uint32 MemberNamesAllocated; // Size of buffer in MemberNames
173-
uint32 CurrentSymbol; // Pointer into SymbolList
172+
uint32_t MemberNamesAllocated; // Size of buffer in MemberNames
173+
uint32_t CurrentSymbol; // Pointer into SymbolList
174174
// Statistics counters
175175
int CountUnderscoreConversions; // Count number of times symbol leading underscores are changed
176176
int CountSectionDotConversions; // Count number of times leading character is changed on section names

0 commit comments

Comments
 (0)