This is an archive of the discontinued LLVM Phabricator instance.

MachO: support N_INDR aliases in the assembler
ClosedPublic

Authored by t.p.northover on May 23 2014, 5:48 AM.

Details

Summary

Hi,

This patch should allow LLVM to emit N_INDR symbols (essentially telling the linker that some symbol should be resolved to another named one when it becomes available).

I'm not all that good at the actual MachO object format though, so I may have made some mistakes. Does it look OK?

Cheers.

Tim.

Diff Detail

Event Timeline

t.p.northover retitled this revision from to MachO: support N_INDR aliases in the assembler.
t.p.northover updated this object.
t.p.northover edited the test plan for this revision. (Show Details)
t.p.northover added a reviewer: kledzik.
t.p.northover added a subscriber: Unknown Object (MLST).
kledzik edited edge metadata.May 23 2014, 10:43 AM

What is the visibility of alias symbols? An earlier patch had them global by default, which is unlike other symbols in assembler which are non-extern by default.

The test case relies on the order of the symbols (or relies on llvm-nm sorting them a certain way). Is there a defined order to where the N_INDR symbols are in the symbol table? The range of global symbols are sorted alphabetically.

Since no public linker supports this yet, we need to make sure that the C side is not enabled and hope no assembly files rely on the old behavior.

Hi Nick,

Thanks for taking a look.

t.p.northover accepted this revision.Jun 26 2014, 6:32 AM
t.p.northover added a reviewer: t.p.northover.
This revision is now accepted and ready to land.Jun 26 2014, 6:32 AM
t.p.northover closed this revision.Jun 26 2014, 6:32 AM