Skip to content

Conversation

@COJIDAT
Copy link

@COJIDAT COJIDAT commented Dec 12, 2025

XCode26 change section name

@davea42
Copy link
Owner

davea42 commented Dec 14, 2025

Could you provide a small or medium sized, non-proprietary, object so I can add it to the regressiontests?
Puzzles me why no change to dwarf_machoread.c was required.
As the pull request is, I don't understand how it can work.

@COJIDAT
Copy link
Author

COJIDAT commented Dec 15, 2025

Could you provide a small or medium sized, non-proprietary, object so I can add it to the regressiontests? Puzzles me why no change to dwarf_machoread.c was required. As the pull request is, I don't understand how it can work.

Hi. I revert changes in dwarf_setup_sections.c , for our code make mapping as in dwarf_machoread.c (SectionNames MachO <-> DWARF).
dwarf_machoread.c read section name sized of 16byte as result suffix __DWARF will be deleted.

In attach Dwarf file from test project.
DwarfTest.zip

@davea42
Copy link
Owner

davea42 commented Dec 16, 2025

Thank you very much for the testcase. I see there are issues. Several issues. From dwarfdump, via libdwarf..
I will be looking into these issues, hopefully today.

@davea42
Copy link
Owner

davea42 commented Dec 16, 2025

Here is the output of readobjmacho (build via my readelfobj-code github project).
Note that libdwarf dwarf_machoread.c already deals with all
the __debug* sections mentioned, renaming to standard DWARF section names.

q3 560: readobjmacho D*
  Total Commands count      : 9
  Total Commands item size  : 3064
  Total Commands space bytes: 27576
Mach-o Magic:  0xfeedfacf
  cputype           : 0x100000c cpusubtype: 0x0
  offset size       : 8
  endian            : LITTLEENDIAN
  file size         : 0x00100ae8
  filetype          : 0xa MH_DSYM
  number of commands: 0x9 (9)
  size of commands  : 0xbf8 (3064)
  flags             : 0x0
Segment name __PAGEZERO
Segment name __TEXT
Segment name __DATA_CONST
Segment name __DATA
Segment name __LINKEDIT
Segment name __DWARF
 Commands: at offset 0x20
  [0] cmd: 0x0000001b LC_UUID          cmdsize: 24 (0x00000018)
  [1] cmd: 0x00000032 LC_BUILD_VERSION cmdsize: 24 (0x00000018)
  [2] cmd: 0x00000002 LC_SYMTAB        cmdsize: 24 (0x00000018)
  [3] cmd: 0x00000019 LC_SEGMENT_64    cmdsize: 72 (0x00000048)
  [4] cmd: 0x00000019 LC_SEGMENT_64    cmdsize: 952 (0x000003b8)
  [5] cmd: 0x00000019 LC_SEGMENT_64    cmdsize: 552 (0x00000228)
  [6] cmd: 0x00000019 LC_SEGMENT_64    cmdsize: 472 (0x000001d8)
  [7] cmd: 0x00000019 LC_SEGMENT_64    cmdsize: 72 (0x00000048)
  [8] cmd: 0x00000019 LC_SEGMENT_64    cmdsize: 872 (0x00000368)
  Segments count:6 starting at 0x00000020:
    command                 segname      fileoff   filesize
  [0] 0x19 LC_SEGMENT_64    __PAGEZERO        0x00000000 0x00000000
  [1] 0x19 LC_SEGMENT_64    __TEXT            0x00000000 0x00000000
  [2] 0x19 LC_SEGMENT_64    __DATA_CONST      0x00000000 0x00000000
  [3] 0x19 LC_SEGMENT_64    __DATA            0x00000000 0x00000000
  [4] 0x19 LC_SEGMENT_64    __LINKEDIT        0x00001000 0x00000d0a
  [5] 0x19 LC_SEGMENT_64    __DWARF           0x00002000 0x000feae8
 Sections count: 28  offset 0x000000f8
                         addr      offset     size 
  [ 0]                  0x00000000 0x00000000 0x00000000
  [ 1] __text           0x100000b60 0x00000000 0x00000170
  [ 2] __stubs          0x100000cd0 0x00000000 0x000000a8
  [ 3] __objc_stubs     0x100000d80 0x00000000 0x00000040
  [ 4] __objc_methlist  0x100000dc0 0x00000000 0x0000056c
  [ 5] __objc_methname  0x10000132c 0x00000000 0x00000e51
  [ 6] __objc_classname 0x10000217d 0x00000000 0x00000070
  [ 7] __objc_methtype  0x1000021ed 0x00000000 0x00000b95
  [ 8] __cstring        0x100002d82 0x00000000 0x00000016
  [ 9] __entitlements   0x100002d98 0x00000000 0x00000116
  [10] __ents_der       0x100002eae 0x00000000 0x00000047
  [11] __unwind_info    0x100002ef8 0x00000000 0x00000070
  [12] __got            0x100004000 0x00000000 0x00000080
  [13] __cfstring       0x100004080 0x00000000 0x00000020
  [14] __objc_classlist 0x1000040a0 0x00000000 0x00000018
  [15] __objc_protolist 0x1000040b8 0x00000000 0x00000020
  [16] __objc_imageinfo 0x1000040d8 0x00000000 0x00000008
  [17] __objc_superrefs 0x1000040e0 0x00000000 0x00000008
  [18] __debug_line     0x10000d000 0x00002000 0x000034f6
  [19] __debug_info     0x1000104f6 0x000054f6 0x000553d5
  [20] __debug_aranges  0x1000658cb 0x0005a8cb 0x000000c0
  [21] __debug_loclists 0x10006598b 0x0005a98b 0x000000bf
  [22] __debug_addr     0x100065a4a 0x0005aa4a 0x000000a8
  [23] __debug_abbrev   0x100065af2 0x0005aaf2 0x000009ce
  [24] __debug_str      0x1000664c0 0x0005b4c0 0x0006cd8b
  [25] __debug_str_offs 0x1000d324b 0x000c824b 0x0001399c
  [26] __debug_line_str 0x1000e6be7 0x000dbbe7 0x00009b07
  [27] __debug_names    0x1000f06f0 0x000e56f0 0x0001b3f8

@davea42 davea42 merged commit df912e5 into davea42:main Dec 16, 2025
@davea42
Copy link
Owner

davea42 commented Dec 16, 2025

Merged using command-line instructions and then
updated so project coding standards followed (about line length).

Thank you very much for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants