[lld-macho][nfc] Simplify LC_DATA_IN_CODE generation
authorJez Ng <jezng@fb.com>
Sat, 11 Dec 2021 06:01:14 +0000 (01:01 -0500)
committerJez Ng <jezng@fb.com>
Sat, 11 Dec 2021 06:01:57 +0000 (01:01 -0500)
commit098430cd25e7d1d5035932db2e4e5f9fb72adfee
treec671b4f6c17eb48609bba6e520f836659f12dcf3
parent40bcbe48e8ecefc6f873acef10f3265401008655
[lld-macho][nfc] Simplify LC_DATA_IN_CODE generation

1. After D113241, we have the section address easily accessible and no
   longer need to iterate across the LC_SEGMENT commands to emit
   LC_DATA_IN_CODE.

2. There's no need to store a pointer to the data in code entries during
   the parse step; we can just look it up as part of the output step.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D115556
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
lld/MachO/SyntheticSections.cpp