handle BOMs in linker response files

Decode UTF-16LE response files with a BOM and strip UTF-8 BOMs before
parsing arguments. Add coverage for UTF-16 response-file input.
This commit is contained in:
Nikita Smith authored and Ryan Fleury committed 2026-07-27 14:47:13 -07:00
1 parent 25430ea522
commit 35722f2a01
2 files changed
+26

No files matched your search

+13
View File
@@ -2791,6 +2791,19 @@ TEST(import_export)
//T_Ok(t_invoke_linkerf("/subsystem:console /entry:entry /out:a.exe /delayload:export.dll /export:entry kernel32.Lib delayimp.lib libcmt.lib export.lib import.obj entry.obj") == 0);
// TODO: check import table
}
TEST(utf16_rsp)
{
T_Ok(t_write_entry_obj());
String8 rsp_text = str8_lit("/subsystem:console /entry:entry /out:a.exe entry.obj\n");
String16 rsp16 = str16_from_8(arena, rsp_text);
String8 rsp_file = str8_cat(arena, str8_lit("\xff\xfe"), str8_array(rsp16.str, rsp16.size));
T_Ok(t_write_file(str8_lit("args.rsp"), rsp_file));
t_invoke_linkerf("@args.rsp");
T_Ok(g_last_exit_code == 0);
}
#endif
TEST(image_base)