#141 (Macho64 format on darwin) – The Yasm Modular Assembler Project

Ticket #141 (closed defect: fixed)

Opened 22 months ago

Last modified 17 months ago

Macho64 format on darwin

Reported by: goodwillhart@… Owned by: peter@…
Priority: P1 Milestone:
Component: Object Format: macho Version: 0.6.0
Severity: normal Keywords:
Cc:

Description

I have some gas assembler code which has been converted to Yasm. It works fine on AMD64 but on a Core 2 machine running Darwin it doesn't assemble. The problem is a reference to a global symbol, which needs to support PIC. Of course with the elf format you have wrt rip wrt ..gotpcrel, but on the Core 2 the object format I need to use is macho64. At present the yasm manual has no information on how to write PIC code for macho64, and ..gotpcrel certainly doesn't work.

Attachments

Change History

comment:1 Changed 22 months ago by peter@…

  • owner set to peter@…
  • status changed from new to assigned

At the moment there's not support for macho64 PIC in yasm, but I'll work on fixing it (should be fairly straightforward). It will still be "wrt ..gotpcrel". See developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/dynamic_code.html#//apple_ref/doc/uid/TP40002528-SW2 for some examples (GAS syntax however).

comment:2 Changed 21 months ago by peter

  • status changed from assigned to closed
  • resolution set to fixed

(In [2108]) Fix #141: Add macho64 PIC support. The way PIC relocations are generated for macho64 requires a bit of a hack to detect MOV opcodes and generate GOT_LOAD relocs. GAS contains a similar hack.

comment:3 Changed 17 months ago by peter

(In [2142]) Merge [2108] from trunk (Fix #141, macho64 PIC support).

Add/Change #141 (Macho64 format on darwin)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.