glibc: Emit _IO_stdin_used reference in .rodata.

This fixes an X86_64_32 relocation linker error when targeting gnux32.
This commit is contained in:
Alex Rønne Petersen 2024-10-16 05:43:17 +02:00
parent 50cae505f7
commit 43878f51d9
No known key found for this signature in database

View File

@ -1015,7 +1015,7 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi
}
}
try stubs_asm.appendSlice(".data\n");
try stubs_asm.appendSlice(".rodata\n");
// For some targets, the real `libc.so.6` will contain a weak reference to `_IO_stdin_used`,
// making the linker put the symbol in the dynamic symbol table. We likewise need to emit a
@ -1046,6 +1046,8 @@ pub fn buildSharedObjects(comp: *Compilation, prog_node: std.Progress.Node) !voi
});
}
try stubs_asm.appendSlice(".data\n");
const obj_inclusions_len = try inc_reader.readInt(u16, .little);
sym_i = 0;