Skip to content

Commit c68e441

Browse files
authored
Merge pull request #2 from amontoison/v2.54
Version 2.54
2 parents ae54df6 + 22467aa commit c68e441

File tree

10 files changed

+124
-92
lines changed

10 files changed

+124
-92
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.53 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.54 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+
2022-08-31 version 2.54
2+
* fix problem with ELF files having same string table for symbols and sections (generated by rustc compiler)
3+
14
2022-04-28 version 2.53
25
* add disassembler support for AVX512-FP16, etc.
36

src/cmdline.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
/**************************** cmdline.cpp **********************************
22
* Author: Agner Fog
33
* Date created: 2006-07-25
4-
* Last modified: 2022-04-28
4+
* Last modified: 2023-03-29
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-2022 GNU General Public License http://www.gnu.org/licenses
11+
* Copyright 2006-2023 GNU General Public License http://www.gnu.org/licenses
1212
*****************************************************************************/
1313

1414
#include "stdafx.h"
1515

1616
// List of recognized output file type options
1717
static SIntTxt TypeOptionNames[] = {
1818
{CMDL_OUTPUT_ELF, "elf"},
19+
{CMDL_OUTPUT_ELF, "ELF"},
1920
{CMDL_OUTPUT_PE, "pe"},
21+
{CMDL_OUTPUT_PE, "PE"},
2022
{CMDL_OUTPUT_PE, "coff"},
23+
{CMDL_OUTPUT_PE, "COFF"},
2124
{CMDL_OUTPUT_PE, "cof"},
2225
{CMDL_OUTPUT_PE, "win"},
2326
{CMDL_OUTPUT_OMF, "omf"},
@@ -1186,7 +1189,7 @@ void CCommandLineInterpreter::ReportStatistics() {
11861189
void CCommandLineInterpreter::Help() {
11871190
// Print help message
11881191
printf("\nObject file converter version %.2f for x86 and x86-64 platforms.", OBJCONV_VERSION);
1189-
printf("\nCopyright (c) 2022 by Agner Fog. Gnu General Public License.");
1192+
printf("\nCopyright (c) 2023 by Agner Fog. Gnu General Public License.");
11901193
printf("\n\nUsage: objconv options inputfile [outputfile]");
11911194
printf("\n\nOptions:");
11921195
printf("\n-fXXX[SS] Output file format XXX, word size SS. Supported formats:");

src/coff.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**************************** coff.h *************************************
22
* Author: Agner Fog
33
* Date created: 2006-07-15
4-
* Last modified: 2008-06-04
4+
* Last modified: 2022-08-31
55
* Project: objconv
66
* Module: coff.h
77
* Description:
88
* Header file for definition of structures in MS Windows COFF Intel x86 (PE)
99
* object file format.
1010
*
11-
* Copyright 2006-2008 GNU General Public License http://www.gnu.org/licenses
11+
* Copyright 2006-2022 GNU General Public License http://www.gnu.org/licenses
1212
* Parts (c) 1995 DJ Delorie GNU General Public License
1313
*****************************************************************************/
1414

@@ -355,12 +355,12 @@ union SCOFF_SymTableEntry {
355355
// Section definition
356356
struct {
357357
uint32_t Length;
358-
uint16_t NumberOfRelocations; // Line number in source file
359-
uint16_t NumberOfLineNumbers;
360-
uint32_t CheckSum; // Pointer to line number entry
361-
uint16_t Number; // Symbol table index of next function
362-
uint8_t Selection; // Unused
363-
uint8_t Unused1[3];
358+
uint16_t NumberOfRelocations; // Number of relocation entries for the section
359+
uint16_t NumberOfLineNumbers; // Number of line-number entries for the section
360+
uint32_t CheckSum; // Checksum for communal data
361+
uint16_t Number; // Index of associated section (for COMDAT selection 5)
362+
uint8_t Selection; // COMDAT selection number
363+
uint8_t Unused1[3]; // Unused
364364
} section;
365365
};
366366

src/disasm.h

Lines changed: 12 additions & 12 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: 2022-04-25
4+
* Last modified: 2023-03-29
55
* Project: objconv
66
* Module: disasm.h
77
* Description:
88
* Header file for disassembler
99
*
10-
* Copyright 2007-2022 GNU General Public License http://www.gnu.org/licenses
10+
* Copyright 2007-2023 GNU General Public License http://www.gnu.org/licenses
1111
*****************************************************************************/
1212
#ifndef DISASM_H
1313
#define DISASM_H
@@ -738,27 +738,27 @@ class CDisassembler {
738738
int TranslateAbsAddress(int64_t Addr, int32_t &Sect, uint32_t &Offset); // Translate absolute virtual address to section and offset
739739
void WriteFileBegin(); // Write begin of file
740740
void WriteFileBeginMASM(); // Write MASM-specific file init
741-
void WriteFileBeginYASM(); // Write YASM-specific file init
741+
void WriteFileBeginNASM(); // Write NASM-specific file init
742742
void WriteFileBeginGASM(); // Write GAS-specific file init
743743
void WriteFileEnd(); // Write end of file
744744
void WriteSegmentBegin(); // Write begin of segment
745745
void WriteSegmentBeginMASM(); // Write begin of segment, MASM syntax
746-
void WriteSegmentBeginYASM(); // Write begin of segment, YASM syntax
746+
void WriteSegmentBeginNASM(); // Write begin of segment, NASM syntax
747747
void WriteSegmentBeginGASM(); // Write begin of segment, GAS syntax
748748
void WriteSegmentEnd(); // Write end of segment
749749
void WritePublicsAndExternalsMASM(); // Write public and external symbol definitions, MASM syntax
750-
void WritePublicsAndExternalsYASMGASM(); // Write public and external symbol definitions, YASM and GAS syntax
750+
void WritePublicsAndExternalsNASMGASM(); // Write public and external symbol definitions, NASM and GAS syntax
751751
void WriteFunctionBegin(); // Write begin of function
752752
void WriteFunctionBeginMASM(uint32_t symi, uint32_t scope);// Write begin of function, MASM syntax
753-
void WriteFunctionBeginYASM(uint32_t symi, uint32_t scope);// Write begin of function, YASM syntax
753+
void WriteFunctionBeginNASM(uint32_t symi, uint32_t scope);// Write begin of function, NASM syntax
754754
void WriteFunctionBeginGASM(uint32_t symi, uint32_t scope);// Write begin of function, GAS syntax
755755
void WriteFunctionEnd(); // Write end of function
756756
void WriteFunctionEndMASM(uint32_t symi); // Write end of function, MASM syntax
757-
void WriteFunctionEndYASM(uint32_t symi); // Write end of function, YASM syntax
757+
void WriteFunctionEndNASM(uint32_t symi); // Write end of function, NASM syntax
758758
void WriteFunctionEndGASM(uint32_t symi); // Write end of function, GAS syntax
759759
void WriteCodeLabel(uint32_t symi); // Write private or public code label
760760
void WriteCodeLabelMASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
761-
void WriteCodeLabelYASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
761+
void WriteCodeLabelNASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
762762
void WriteCodeLabelGASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
763763
int WriteFillers(); // Check if code is a series of NOPs or other fillers. If so then write it as such
764764
void WriteAlign(uint32_t a); // Write alignment directive
@@ -782,17 +782,17 @@ class CDisassembler {
782782
void WriteRelocationTarget(uint32_t irel, uint32_t Context, int64_t Addend);// Write cross reference
783783
void WriteOperandType(uint32_t type); // Write type override before operand, e.g. "dword ptr"
784784
void WriteOperandTypeMASM(uint32_t type); // Write type override before operand, e.g. "dword ptr", MASM syntax
785-
void WriteOperandTypeYASM(uint32_t type); // Write type override before operand, e.g. "dword", YASM syntax
785+
void WriteOperandTypeNASM(uint32_t type); // Write type override before operand, e.g. "dword", NASM syntax
786786
void WriteOperandTypeGASM(uint32_t type); // Write type override before operand, e.g. "dword ptr", GAS syntax
787787
void WriteDataItems(); // Write data items
788788
void WriteDataLabelMASM(const char * name, uint32_t sym, int line); // Write label before data item, MASM syntax
789-
void WriteDataLabelYASM(const char * name, uint32_t sym, int line); // Write label before data item, YASM syntax
789+
void WriteDataLabelNASM(const char * name, uint32_t sym, int line); // Write label before data item, NASM syntax
790790
void WriteDataLabelGASM(const char * name, uint32_t sym, int line); // Write label before data item, GAS syntax
791791
void WriteUninitDataItemsMASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, MASM syntax
792-
void WriteUninitDataItemsYASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, YASM syntax
792+
void WriteUninitDataItemsNASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, NASM syntax
793793
void WriteUninitDataItemsGASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, GAS syntax
794794
void WriteDataDirectiveMASM(uint32_t size); // Write DB, etc., MASM syntax
795-
void WriteDataDirectiveYASM(uint32_t size); // Write DB, etc., MASM syntax
795+
void WriteDataDirectiveNASM(uint32_t size); // Write DB, etc., MASM syntax
796796
void WriteDataDirectiveGASM(uint32_t size); // Write DB, etc., MASM syntax
797797
void WriteDataComment(uint32_t ElementSize, uint32_t LinePos, uint32_t Pos, uint32_t irel);// Write comment after data item
798798
uint32_t GetDataItemSize(uint32_t Type); // Get size of data item with specified type

0 commit comments

Comments
 (0)