mirror of
https://github.com/rui314/mold.git
synced 2024-09-21 09:57:18 +03:00
[Mach-O] wip
This commit is contained in:
parent
18fb0d5d3f
commit
c0daab6075
@ -44,7 +44,7 @@ static void create_synthetic_sections(Context &ctx) {
|
||||
|
||||
ctx.data_const_seg->sections.push_back(new GotSection(*ctx.data_const_seg));
|
||||
|
||||
ctx.data_seg->sections.push_back(new LaSymbolPtrSection(*ctx.data_seg));
|
||||
ctx.data_seg->sections.push_back(new LazySymbolPtrSection(*ctx.data_seg));
|
||||
ctx.data_seg->sections.push_back(new DataSection(*ctx.data_seg));
|
||||
|
||||
ctx.rebase.reset(new OutputRebaseSection(*ctx.linkedit_seg));
|
||||
|
@ -285,9 +285,9 @@ public:
|
||||
static constexpr char contents[] = "Hello world\n";
|
||||
};
|
||||
|
||||
class LaSymbolPtrSection : public OutputSection {
|
||||
class LazySymbolPtrSection : public OutputSection {
|
||||
public:
|
||||
LaSymbolPtrSection(OutputSegment &parent);
|
||||
LazySymbolPtrSection(OutputSegment &parent);
|
||||
void copy_buf(Context &ctx) override;
|
||||
|
||||
std::vector<u8> contents = {0x94, 0x3f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00};
|
||||
|
@ -676,7 +676,7 @@ GotSection::GotSection(OutputSegment &parent)
|
||||
hdr.reserved1 = 1;
|
||||
}
|
||||
|
||||
LaSymbolPtrSection::LaSymbolPtrSection(OutputSegment &parent)
|
||||
LazySymbolPtrSection::LazySymbolPtrSection(OutputSegment &parent)
|
||||
: OutputSection(parent) {
|
||||
strcpy(hdr.sectname, "__la_symbol_ptr");
|
||||
hdr.p2align = __builtin_ctz(8);
|
||||
@ -685,7 +685,7 @@ LaSymbolPtrSection::LaSymbolPtrSection(OutputSegment &parent)
|
||||
hdr.reserved1 = 2;
|
||||
}
|
||||
|
||||
void LaSymbolPtrSection::copy_buf(Context &ctx) {
|
||||
void LazySymbolPtrSection::copy_buf(Context &ctx) {
|
||||
write_vector(ctx.buf + hdr.offset, contents);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user