[PATCH] D119668: [lld-macho] Add -static

Jared Irwin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 13 08:39:34 PST 2022


Link1J created this revision.
Link1J added reviewers: int3, lld-macho.
Link1J added a project: lld-macho.
Herald added a subscriber: dang.
Link1J requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Adds `-static` (and `-add_load_version`)

`-static` drives will probably drive me (or anyone) insane if it is to be completely and correctly implemented. It seems to touch everything, and I don't even know if everything below is all that it does.

Implemented behavior:

- Entry is defined by `LC_UNIXTHREAD` command
- `LC_BUILD_VERSION` and `LC_VERSION_MIN_*` are no longer emitted by default
- `LC_FUNCTION_STARTS` is no longer emitted by default
- `LC_DATA_IN_CODE` is no longer emitted by default
- `LC_ENCRYPTION_INFO` is no longer emitted by default
- `LC_LOAD_DYLINKER` is no longer emitted
- Default entry becomes `start`
- Is not PIC by default.

Will be implemented:

- `-image_base` effecting the `__PAGEZERO` and not the `__TEXT`

Not implemented behavior:

- `-arch` is not needed
- `-platform_version` is not needed
- Forcing `-keep_dwarf_unwind`, even if `-no_keep_dwarf_unwind` is provided (I don't if they are implemented)

Notes within notes:

- The tests for `-static` will need fixing if `LC_SOURCE_VERSION` is added


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119668

Files:
  lld/MachO/Arch/ARM.cpp
  lld/MachO/Arch/ARM64.cpp
  lld/MachO/Arch/ARM64_32.cpp
  lld/MachO/Arch/X86_64.cpp
  lld/MachO/Config.h
  lld/MachO/Driver.cpp
  lld/MachO/Options.td
  lld/MachO/Target.h
  lld/MachO/Writer.cpp
  lld/test/MachO/static.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119668.408267.patch
Type: text/x-patch
Size: 14155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220213/25576b34/attachment.bin>


More information about the llvm-commits mailing list