Skip to content

Commit

Permalink
Merge pull request #2 from amontoison/v2.54
Browse files Browse the repository at this point in the history
Version 2.54
  • Loading branch information
staticfloat authored Nov 27, 2023
2 parents ae54df6 + 22467aa commit c68e441
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 92 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## objconv

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.
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.

To regenerate this repository, run `./update.sh`.
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2022-08-31 version 2.54
* fix problem with ELF files having same string table for symbols and sections (generated by rustc compiler)

2022-04-28 version 2.53
* add disassembler support for AVX512-FP16, etc.

Expand Down
9 changes: 6 additions & 3 deletions src/cmdline.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
/**************************** cmdline.cpp **********************************
* Author: Agner Fog
* Date created: 2006-07-25
* Last modified: 2022-04-28
* Last modified: 2023-03-29
* Project: objconv
* Module: cmdline.cpp
* Description:
* This module is for interpretation of command line options
* Also contains symbol change function
*
* Copyright 2006-2022 GNU General Public License http://www.gnu.org/licenses
* Copyright 2006-2023 GNU General Public License http://www.gnu.org/licenses
*****************************************************************************/

#include "stdafx.h"

// List of recognized output file type options
static SIntTxt TypeOptionNames[] = {
{CMDL_OUTPUT_ELF, "elf"},
{CMDL_OUTPUT_ELF, "ELF"},
{CMDL_OUTPUT_PE, "pe"},
{CMDL_OUTPUT_PE, "PE"},
{CMDL_OUTPUT_PE, "coff"},
{CMDL_OUTPUT_PE, "COFF"},
{CMDL_OUTPUT_PE, "cof"},
{CMDL_OUTPUT_PE, "win"},
{CMDL_OUTPUT_OMF, "omf"},
Expand Down Expand Up @@ -1186,7 +1189,7 @@ void CCommandLineInterpreter::ReportStatistics() {
void CCommandLineInterpreter::Help() {
// Print help message
printf("\nObject file converter version %.2f for x86 and x86-64 platforms.", OBJCONV_VERSION);
printf("\nCopyright (c) 2022 by Agner Fog. Gnu General Public License.");
printf("\nCopyright (c) 2023 by Agner Fog. Gnu General Public License.");
printf("\n\nUsage: objconv options inputfile [outputfile]");
printf("\n\nOptions:");
printf("\n-fXXX[SS] Output file format XXX, word size SS. Supported formats:");
Expand Down
16 changes: 8 additions & 8 deletions src/coff.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**************************** coff.h *************************************
* Author: Agner Fog
* Date created: 2006-07-15
* Last modified: 2008-06-04
* Last modified: 2022-08-31
* Project: objconv
* Module: coff.h
* Description:
* Header file for definition of structures in MS Windows COFF Intel x86 (PE)
* object file format.
*
* Copyright 2006-2008 GNU General Public License http://www.gnu.org/licenses
* Copyright 2006-2022 GNU General Public License http://www.gnu.org/licenses
* Parts (c) 1995 DJ Delorie GNU General Public License
*****************************************************************************/

Expand Down Expand Up @@ -355,12 +355,12 @@ union SCOFF_SymTableEntry {
// Section definition
struct {
uint32_t Length;
uint16_t NumberOfRelocations; // Line number in source file
uint16_t NumberOfLineNumbers;
uint32_t CheckSum; // Pointer to line number entry
uint16_t Number; // Symbol table index of next function
uint8_t Selection; // Unused
uint8_t Unused1[3];
uint16_t NumberOfRelocations; // Number of relocation entries for the section
uint16_t NumberOfLineNumbers; // Number of line-number entries for the section
uint32_t CheckSum; // Checksum for communal data
uint16_t Number; // Index of associated section (for COMDAT selection 5)
uint8_t Selection; // COMDAT selection number
uint8_t Unused1[3]; // Unused
} section;
};

Expand Down
24 changes: 12 additions & 12 deletions src/disasm.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**************************** disasm.h **********************************
* Author: Agner Fog
* Date created: 2007-02-21
* Last modified: 2022-04-25
* Last modified: 2023-03-29
* Project: objconv
* Module: disasm.h
* Description:
* Header file for disassembler
*
* Copyright 2007-2022 GNU General Public License http://www.gnu.org/licenses
* Copyright 2007-2023 GNU General Public License http://www.gnu.org/licenses
*****************************************************************************/
#ifndef DISASM_H
#define DISASM_H
Expand Down Expand Up @@ -738,27 +738,27 @@ class CDisassembler {
int TranslateAbsAddress(int64_t Addr, int32_t &Sect, uint32_t &Offset); // Translate absolute virtual address to section and offset
void WriteFileBegin(); // Write begin of file
void WriteFileBeginMASM(); // Write MASM-specific file init
void WriteFileBeginYASM(); // Write YASM-specific file init
void WriteFileBeginNASM(); // Write NASM-specific file init
void WriteFileBeginGASM(); // Write GAS-specific file init
void WriteFileEnd(); // Write end of file
void WriteSegmentBegin(); // Write begin of segment
void WriteSegmentBeginMASM(); // Write begin of segment, MASM syntax
void WriteSegmentBeginYASM(); // Write begin of segment, YASM syntax
void WriteSegmentBeginNASM(); // Write begin of segment, NASM syntax
void WriteSegmentBeginGASM(); // Write begin of segment, GAS syntax
void WriteSegmentEnd(); // Write end of segment
void WritePublicsAndExternalsMASM(); // Write public and external symbol definitions, MASM syntax
void WritePublicsAndExternalsYASMGASM(); // Write public and external symbol definitions, YASM and GAS syntax
void WritePublicsAndExternalsNASMGASM(); // Write public and external symbol definitions, NASM and GAS syntax
void WriteFunctionBegin(); // Write begin of function
void WriteFunctionBeginMASM(uint32_t symi, uint32_t scope);// Write begin of function, MASM syntax
void WriteFunctionBeginYASM(uint32_t symi, uint32_t scope);// Write begin of function, YASM syntax
void WriteFunctionBeginNASM(uint32_t symi, uint32_t scope);// Write begin of function, NASM syntax
void WriteFunctionBeginGASM(uint32_t symi, uint32_t scope);// Write begin of function, GAS syntax
void WriteFunctionEnd(); // Write end of function
void WriteFunctionEndMASM(uint32_t symi); // Write end of function, MASM syntax
void WriteFunctionEndYASM(uint32_t symi); // Write end of function, YASM syntax
void WriteFunctionEndNASM(uint32_t symi); // Write end of function, NASM syntax
void WriteFunctionEndGASM(uint32_t symi); // Write end of function, GAS syntax
void WriteCodeLabel(uint32_t symi); // Write private or public code label
void WriteCodeLabelMASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
void WriteCodeLabelYASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
void WriteCodeLabelNASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
void WriteCodeLabelGASM(uint32_t symi, uint32_t scope);// Write private or public code label, MASM syntax
int WriteFillers(); // Check if code is a series of NOPs or other fillers. If so then write it as such
void WriteAlign(uint32_t a); // Write alignment directive
Expand All @@ -782,17 +782,17 @@ class CDisassembler {
void WriteRelocationTarget(uint32_t irel, uint32_t Context, int64_t Addend);// Write cross reference
void WriteOperandType(uint32_t type); // Write type override before operand, e.g. "dword ptr"
void WriteOperandTypeMASM(uint32_t type); // Write type override before operand, e.g. "dword ptr", MASM syntax
void WriteOperandTypeYASM(uint32_t type); // Write type override before operand, e.g. "dword", YASM syntax
void WriteOperandTypeNASM(uint32_t type); // Write type override before operand, e.g. "dword", NASM syntax
void WriteOperandTypeGASM(uint32_t type); // Write type override before operand, e.g. "dword ptr", GAS syntax
void WriteDataItems(); // Write data items
void WriteDataLabelMASM(const char * name, uint32_t sym, int line); // Write label before data item, MASM syntax
void WriteDataLabelYASM(const char * name, uint32_t sym, int line); // Write label before data item, YASM syntax
void WriteDataLabelNASM(const char * name, uint32_t sym, int line); // Write label before data item, NASM syntax
void WriteDataLabelGASM(const char * name, uint32_t sym, int line); // Write label before data item, GAS syntax
void WriteUninitDataItemsMASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, MASM syntax
void WriteUninitDataItemsYASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, YASM syntax
void WriteUninitDataItemsNASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, NASM syntax
void WriteUninitDataItemsGASM(uint32_t size, uint32_t count);// Write uninitialized (BSS) data, GAS syntax
void WriteDataDirectiveMASM(uint32_t size); // Write DB, etc., MASM syntax
void WriteDataDirectiveYASM(uint32_t size); // Write DB, etc., MASM syntax
void WriteDataDirectiveNASM(uint32_t size); // Write DB, etc., MASM syntax
void WriteDataDirectiveGASM(uint32_t size); // Write DB, etc., MASM syntax
void WriteDataComment(uint32_t ElementSize, uint32_t LinePos, uint32_t Pos, uint32_t irel);// Write comment after data item
uint32_t GetDataItemSize(uint32_t Type); // Get size of data item with specified type
Expand Down
Loading

0 comments on commit c68e441

Please sign in to comment.