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

Ticket #141 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years 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 2 years 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 2 years 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 2 years ago by peter

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

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.