Skip to content

Commit ac83360

Browse files
authored
Merge pull request #3 from eschnett/eschnett/update
2023-08-16 version 2.55
2 parents c68e441 + 55e693d commit ac83360

File tree

7 files changed

+24
-18
lines changed

7 files changed

+24
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## objconv
22

3-
This is a git mirror of [objconv](http://www.agner.org/optimize/), by Agner Fog. All rights belong to Agner Fog. As of this writing, this repository contains version 2.54 of objconv.
3+
This is a git mirror of [objconv](http://www.agner.org/optimize/), by Agner Fog. All rights belong to Agner Fog. As of this writing, this repository contains version 2.55 of objconv.
44

55
To regenerate this repository, run `./update.sh`.

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2023-08-16 version 2.55
2+
* cosmetic fix in disassembly of sign-extended 8-bit and 16-bit constants
3+
14
2022-08-31 version 2.54
25
* fix problem with ELF files having same string table for symbols and sections (generated by rustc compiler)
36

src/cmdline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ void CCommandLineInterpreter::ReportStatistics() {
11891189
void CCommandLineInterpreter::Help() {
11901190
// Print help message
11911191
printf("\nObject file converter version %.2f for x86 and x86-64 platforms.", OBJCONV_VERSION);
1192-
printf("\nCopyright (c) 2023 by Agner Fog. Gnu General Public License.");
1192+
printf("\nCopyright (c) 2025 by Agner Fog. Gnu General Public License.");
11931193
printf("\n\nUsage: objconv options inputfile [outputfile]");
11941194
printf("\n\nOptions:");
11951195
printf("\n-fXXX[SS] Output file format XXX, word size SS. Supported formats:");

src/disasm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**************************** disasm.h **********************************
22
* Author: Agner Fog
33
* Date created: 2007-02-21
4-
* Last modified: 2023-03-29
4+
* Last modified: 2025-08-26
55
* Project: objconv
66
* Module: disasm.h
77
* Description:
88
* Header file for disassembler
99
*
10-
* Copyright 2007-2023 GNU General Public License http://www.gnu.org/licenses
10+
* Copyright 2007-2025 GNU General Public License http://www.gnu.org/licenses
1111
*****************************************************************************/
1212
#ifndef DISASM_H
1313
#define DISASM_H
@@ -435,7 +435,7 @@ struct SOpcodeProp {
435435
uint32_t Vreg; // ~VEX.vvvv or AMD DREX byte
436436
uint32_t Kreg; // EVEX.aaa = MVEX.kkk mask register
437437
uint32_t Esss; // EVEX.zLLb = MVEX.Esss option bits
438-
SwizSpec const * SwizRecord; // Selected entry in MVEX table for MVEX code
438+
SwizSpec const * SwizRecord; // Selected entry in MVEX table for MVEX code
439439
uint32_t OffsetMultiplier; // Multiplier for 1-byte offset calculated from EVEX or obtained from MVEX.sss and table lookup
440440
uint32_t Operands[5]; // Operand types for destination, source, immediate
441441
uint32_t OpcodeStart1; // Index to first opcode byte, after prefixes
@@ -446,8 +446,8 @@ struct SOpcodeProp {
446446
uint32_t ImmediateField; // Beginning of immediate operand or jump address field
447447
uint32_t ImmediateFieldSize; // Size of immediate operand or jump address field
448448
uint32_t ImmediateRelocation; // Relocation pointing to immediate operand or jump address field
449-
const char * OpComment; // Additional comment for opcode
450-
void Reset() { // Set everything to zero
449+
const char * OpComment; // Additional comment for opcode
450+
void Reset() { // Set everything to zero
451451
memset(this, 0, sizeof(*this));}
452452
};
453453
// The meaning of each bit in s.Warnings and s.Errors is given in

src/disasm1.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**************************** disasm1.cpp ********************************
22
* Author: Agner Fog
33
* Date created: 2007-02-25
4-
* Last modified: 2022-08-02
4+
* Last modified: 2025-08-26
55
* Project: objconv
66
* Module: disasm1.cpp
77
* Description:
@@ -11,7 +11,7 @@
1111
* Instruction tables are in opcodes.cpp.
1212
* All functions relating to file output are in disasm2.cpp
1313
*
14-
* Copyright 2007-2022 GNU General Public License http://www.gnu.org/licenses
14+
* Copyright 2007-2025 GNU General Public License http://www.gnu.org/licenses
1515
*****************************************************************************/
1616
#include "stdafx.h"
1717

src/disasm2.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/**************************** disasm2.cpp ********************************
22
* Author: Agner Fog
33
* Date created: 2007-02-25
4-
* Last modified: 2023-03-29
4+
* Last modified: 2025-08-26
55
* Project: objconv
66
* Module: disasm2.cpp
77
* Description:
88
* Module for disassembler containing file output functions
99
*
1010
* Changes that relate to assembly language syntax should be done in this file only.
1111
*
12-
* Copyright 2007-2023 GNU General Public License http://www.gnu.org/licenses
12+
* Copyright 2007-2025 GNU General Public License http://www.gnu.org/licenses
1313
*****************************************************************************/
1414
#include "stdafx.h"
1515

@@ -72,7 +72,7 @@ SIntTxt AsmWarningTexts1[] = {
7272
{8, "Displacement could be made smaller by sign extension"},
7373
{0x10, "SIB byte unnecessary here"},
7474
{0x20, "A shorter instruction exists for register operand"},
75-
{0x40, "Length-changing prefix causes delay on Intel processors"},
75+
{0x40, "Length-changing prefix causes delay on old Intel processors"},
7676
{0x80, "Address size prefix should be avoided"},
7777
{0x100, "Same prefix occurs more than once"},
7878
{0x200, "Prefix valid but unnecessary"},
@@ -91,7 +91,7 @@ SIntTxt AsmWarningTexts1[] = {
9191
{0x400000, "Memory operand is misaligned. Performance penalty"},
9292
{0x800000, "Alignment fault. Memory operand must be aligned"},
9393
{0x1000000, "Multi-byte NOP. Replace with ALIGN"},
94-
{0x2000000, "Bogus length-changing prefix causes delay on Intel processors here"},
94+
{0x2000000, "Bogus length-changing prefix causes delay on old Intel processors here"},
9595
{0x4000000, "Non-default size for stack operation"},
9696
{0x8000000, "Function does not end with ret or jmp"},
9797
{0x10000000, "No jump seems to point here"},
@@ -1098,6 +1098,9 @@ void CDisassembler::WriteImmediateOperand(uint32_t Type) {
10981098
if ((s.Operands[0] & 0xFFF) <= 0xA && s.Operands[0] != 0 || (s.Operands[0] & 0xF0) == 0xA0) {
10991099
// Destination is general purpose register
11001100
OSize = s.OperandSize;
1101+
if ((s.Operands[0] & 0x0F) < 3) {
1102+
OSize = (s.Operands[0] & 0x0F) << 3;
1103+
}
11011104
}
11021105
else {
11031106
// Constant probably unrelated to destination size
@@ -1108,8 +1111,8 @@ void CDisassembler::WriteImmediateOperand(uint32_t Type) {
11081111

11091112
// Check if sign extended
11101113
if (OSize > s.ImmediateFieldSize * 8) {
1111-
if (WriteFormat == 2 && Value >= 0) {
1112-
// Hexadecimal sign extended, not negative:
1114+
if (WriteFormat == 2 && Value >= 0) {
1115+
// Hexadecimal sign extended
11131116
// Does not need full length
11141117
OSize = s.ImmediateFieldSize * 8;
11151118
}

src/maindef.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/**************************** maindef.h **********************************
22
* Author: Agner Fog
33
* Date created: 2006-08-26
4-
* Last modified: 2022-08-31
4+
* Last modified: 2025-08-26
55
* Project: objconv
66
* Module: maindef.h
77
* Description:
88
* Header file for type definitions and other main definitions.
99
*
10-
* Copyright 2006-2022 GNU General Public License v. 3 http://www.gnu.org/licenses
10+
* Copyright 2006-2025 GNU General Public License v. 3 http://www.gnu.org/licenses
1111
*****************************************************************************/
1212
#ifndef MAINDEF_H
1313
#define MAINDEF_H
1414

1515
// Program version
16-
#define OBJCONV_VERSION 2.54
16+
#define OBJCONV_VERSION 2.55
1717

1818

1919
// Integer type definitions with platform-independent sizes:

0 commit comments

Comments
 (0)