Skip to content

Commit 4d83e7c

Browse files
authored
Merge pull request #5 from eschnett/eschnett/2.56
2025-10-30 version 2.56
2 parents ac83360 + 016535a commit 4d83e7c

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2025-10-30 version 2.56
2+
* minor change in elf2mac.cpp
3+
14
2023-08-16 version 2.55
25
* cosmetic fix in disassembly of sign-extended 8-bit and 16-bit constants
36

src/elf2mac.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**************************** elf2mac.cpp *********************************
22
* Author: Agner Fog
33
* Date created: 2007-01-10
4-
* Last modified: 2012-05-05
4+
* Last modified: 2025-10-30
55
* Project: objconv
66
* Module: elf2mac.cpp
77
* Description:
88
* Module for converting ELF file to Mach-O file
99
*
10-
* Copyright 2007-2012 GNU General Public License http://www.gnu.org/licenses
10+
* Copyright 2007-2025 GNU General Public License http://www.gnu.org/licenses
1111
*****************************************************************************/
1212

1313
#include "stdafx.h"
@@ -224,7 +224,22 @@ void CELF2MAC<ELFSTRUCTURES,MACSTRUCTURES>::MakeSymbolTable() {
224224

225225
if (NewSymTab[0].GetNumEntries() == 0) {
226226
// make empty symbol record for index 0
227+
// NOTE on linking an objconv-elf2mac-converted .o with ld_classic vs. with ld_new:
228+
// - ld_classic can handle this dummy entry with n_type=MAC_N_UNDF(0) without any problem
229+
// - ld_new (indroduced with XCode 15) terminates with an assert, if it finds this dummy entry
230+
// with n_type=MAC_N_UNDF(0) and there are other non-dummy undefined symbol entries in the .o file:
231+
// 0 0x1045e81bc __assert_rtn + 72
232+
// 1 0x10450d5bc ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15360
233+
// 2 0x10451688c ld::InputFiles::SliceParser::parse() const + 696
234+
// ...
235+
// ld: Assertion failed: (firstUndefinedSymbol != 0), function parseObjectFile, file InputFiles.cpp, line 1810.
236+
// - a working fix for objconv to make the ld_new happy: use MAC_N_ABS(2) for the n_type of the dummy entry!
237+
//#define ELF2MAC_USE_MAC_N_ABS_FOR_DUMMY_SYMBOL
238+
#ifndef ELF2MAC_USE_MAC_N_ABS_FOR_DUMMY_SYMBOL
227239
NewSymTab[0].AddSymbol(0, "", 0, 0, 0, 0);
240+
#else
241+
NewSymTab[0].AddSymbol(0, "", MAC_N_ABS, 0, 0, 0);
242+
#endif
228243
}
229244

230245
// Loop through old symbol table

src/maindef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**************************** maindef.h **********************************
22
* Author: Agner Fog
33
* Date created: 2006-08-26
4-
* Last modified: 2025-08-26
4+
* Last modified: 2025-10-30
55
* Project: objconv
66
* Module: maindef.h
77
* Description:
@@ -13,7 +13,7 @@
1313
#define MAINDEF_H
1414

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

1818

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

0 commit comments

Comments
 (0)