[Bug target/98693] Compiling with -mcmodel=large emits .eh_frame with R_X86_64_PC32

2021-01-17 Thread chorman64 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98693

--- Comment #1 from connor horman  ---
In case they are helpful in confirming the bug, these are the outputs from
continuous integration runs: 
clang+lld (expected case):
https://github.com/PhantomOS/PhantomOS/runs/1717516076
cross gcc+binutils (failing case):
https://github.com/PhantomOS/PhantomOS/runs/1717516064

[Bug c/98693] New: Compiling with -mcmodel=large emits .eh_frame with R_X86_64_PC32

2021-01-14 Thread chorman64 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98693

Bug ID: 98693
   Summary: Compiling with -mcmodel=large emits .eh_frame with
R_X86_64_PC32
   Product: gcc
   Version: 10.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chorman64 at gmail dot com
  Target Milestone: ---

I am attempting to use gcc to build an operating system for x86_64. I recently
reconfigured it to use the higher half of memory so that OS routines may be
preserved in userspace maps. However, when building with gcc using
`-mcmodel=large`, I get relocation overflow errors (from gold) in `.eh_frame`
(which is presumably a synthetic section, as I have written no sections by that
name). The error persists using gcc with lld (though it is reported
differently, and reports the relocation).
The same issue does not occur when building with the same flags using clang
with lld.