public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114543] New: mcmodel=kernel generates relocation that definitely can't be handled
@ 2024-04-01 6:00 pinskia at gcc dot gnu.org
0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu.org @ 2024-04-01 6:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114543
Bug ID: 114543
Summary: mcmodel=kernel generates relocation that definitely
can't be handled
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Keywords: link-failure
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Target: x86_64-linux-gnu
Take:
```
const char *f()
{
return "1" + 2147483647;
}
int main() {}
```
Compile/link with `-O2 mcmodel=kernel` and you get:
```
ASM generation compiler returned: 0
/tmp/cc57BgGX.o: in function `f()':
example.cpp:(.text+0x3): relocation truncated to fit: R_X86_64_32S against
`.LC0'
collect2: error: ld returned 1 exit status
Execution build compiler returned: 1
```
That is because GCC Produces:
```
movq $.LC0+2147483647, %rax
```
But it should have split up the addon from the LC0 here.
Note that was reported in PR 91420 originally but that is a riscv64 backend
issue rather than one in the x86_64 backend.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-01 6:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-01 6:00 [Bug target/114543] New: mcmodel=kernel generates relocation that definitely can't be handled pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).