Fangrui Song 0b4147e0bc
[X86] Restrict offset folding into address mode in 16-bit mode (#179399)
106549a436/src/pnpbios.c (L70)
has code that looks like
```
extern int X;
unsigned f(void) { return (unsigned)&X - 0xf0000; }
```

which compiles (-O1 or above, -fno-pic) to

```
.code16
leal X-983040, %eax  # R_386_16 relocation, [-65535,65535]
```
in 16-bit mode. This is rejected by both GNU Assembler and LLVM
integrated assembler (after #176827).

Restrict offset folding in 16-bit mode to the range [-65535, 65535].
2026-02-03 17:07:09 +00:00
..