0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-08-23 10:33:50 -04:00

Merge 52990b6f7cc678cec5e29e3cd0e7c0f4096de0be into ada267ec8cb708317e707158f0296fab5ccb794e

This commit is contained in:
Mathias Berchtold 2025-08-19 05:23:49 +08:00 committed by GitHub
commit 5b8ee597f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1041,8 +1041,8 @@ static void coff_write(void)
/* fill in the .drectve section with -export's */ /* fill in the .drectve section with -export's */
BuildExportTable(&Exports); BuildExportTable(&Exports);
if (win32) { /* Emit an absolute @feat.00 symbol */
/* add default value for @feat.00, this allows to 'link /safeseh' */ {
uint32_t n; uint32_t n;
saa_rewind(coff_syms); saa_rewind(coff_syms);
@ -1051,8 +1051,15 @@ static void coff_write(void)
if (sym->strpos == -1 && !strcmp("@feat.00",sym->name)) if (sym->strpos == -1 && !strcmp("@feat.00",sym->name))
break; break;
} }
if (n == coff_nsyms) if (n == coff_nsyms) {
coff_deflabel("@feat.00", NO_SEG, 1, 0, NULL); int64_t feat00_flags = 0;
if (win32)
/* marks the object for "registered SEH". this allows to 'link /safeseh' */
feat00_flags |= 1;
feat00_flags |= 0x800; /* object is CFG-aware */
coff_deflabel("@feat.00", NO_SEG, feat00_flags, 0, NULL);
}
} }
/* /*