Commit Graph

15 Commits

Author SHA1 Message Date
Marcel Moolenaar
7df304f3e0 Stop linking against a direct-mapped virtual address and instead
use the PBVM. This eliminates the implied hardcoding of the
physical address at which the kernel needs to be loaded. Using the
PBVM makes it possible to load the kernel irrespective of the
physical memory organization and allows us to replicate kernel text
on NUMA machines.

While here, reduce the direct-mapped page size to the kernel's
page size so that we can support memory attributes better.
2011-04-30 20:49:00 +00:00
Marcel Moolenaar
9b0a458bcc o Move the IVT and supporting functions to the front of the text
segment so that it's always mapped by the loader.
o   Change the alternate fault handlers to account for PBVM. Since
    currently the region is handled by the VHPT, no alternate faults
    will be generated for it.
2011-03-18 22:45:43 +00:00
Dimitry Andric
e3c77b8170 For ia64, add a proper 'elf64-ia64-freebsd' output format to BFD, so the
ELF branding for FreeBSD is done in the same way as amd64, i386 and
sparc.  Something similar should probably also be done for arm, mips and
powerpc.
2010-12-05 20:24:22 +00:00
Marcel Moolenaar
09814dd676 Have the linker provide btext. It's used for profiling. 2004-08-25 07:43:28 +00:00
Marcel Moolenaar
5526395941 Fix the following error:
ld: locore.o: non-pic code with imm relocation against dynamic
	symbol `__gp'

With binutils 2.15, ld(1) defines the implicit/automatic symbol __gp
as a dynamic symbol and thus will now complain when used in a non-PIC
fashion (the immediate relocation used to set the GP register). Resolve
this by defining __gp in the linker script. Make sure __gp is aligned
on a 16-byte boundary.

Note: the 0x200000 magic offset is due to having a 22-bit GP-relative
relocation. The GOT will be accessed with negative offsets from GP.
2004-06-20 22:32:19 +00:00
Marcel Moolenaar
dfbd7790d4 Load the kernel at a 64M instead of 5M. The advantage of this is that
we can switch to 64M-sized identity mappings and not having to map the
first 64M. This is especially important because the first 1M contains
the VGA frame buffer and is otherwise a legacy memory range. Best to
make as little assumptions about it as possible. Switching to 64M-sized
mappings is important to avoid creating overlapping translations, which
have the side-effect of triggering machine checks. This is currently
what's preventing us to boot on an Intel Tiger 4.

Note that since we currently use 256M-sized identity mappings, we
would reduce the size of the mappings and consequently increase the
TLB pressure. The performance implications of this are minimal if
measurable at all because identify mappings are not our primary
means for memory management.

Also note that there's no guarantee that physical memory exists at
64M. Then again, we didn't had the guarantee when we were loading at
5M. We'll deal with this when it's a problem.

Discussed with: arun@
2003-09-06 05:15:36 +00:00
Marcel Moolenaar
5551d84398 Sync the linker script with the one used by default for userland. Since
ia64 only uses relocations with addend, remove the sections specific to
non-addend relocations (.rel.*). Also remove C++ specific sections.

Approved by: re@ (blanket)
2003-05-16 06:03:45 +00:00
David E. O'Brien
b07af2c4b2 Back out rev 1.7 -- I'm not sure we're ready for it and I can't test it.
Marcel will find out RSN if it is needed and I'll let him fix this up if
need be.
2002-12-05 18:35:44 +00:00
David E. O'Brien
dfe585cc69 Our binary output format is now "elf64-ia64-little-freebsd". 2002-12-05 18:28:01 +00:00
Marcel Moolenaar
0635b341f2 Remove the _ia64_unwind_start and _ia64_unwind_end symbols. We now
find the unwind table through the ELF program headers.
2002-10-19 19:32:21 +00:00
Marcel Moolenaar
5d3ac4cae7 Cover the ELF headers with the text segment so that they get loaded
into memory. This brings us in line with the other architectures and
more easily allows us to do machine dependent processing on the ELF
file (such as scanning for unwind information).
2002-10-18 04:46:36 +00:00
Marcel Moolenaar
bb461594f9 Have the linker collect and combine all unwind_info and unwind
sections so that the resulting load module has a single unwind
table. This matches the behaviour in userland.
2002-10-12 22:24:41 +00:00
Doug Rabson
a4addc62ce Put symbols at the start and end of the unwind section so that we can
find it at runtime.
2001-10-29 11:40:14 +00:00
Doug Rabson
9c738f3e82 Change the kernel layout to match Linux/ia64 more closely. This prevents
the Linux loader from corrupting our text section when it attempts to
write out boot options.
2001-03-09 13:47:25 +00:00
Doug Rabson
1ebcad5720 This is the first snapshot of the FreeBSD/ia64 kernel. This kernel will
not work on any real hardware (or fully work on any simulator). Much more
needs to happen before this is actually functional but its nice to see
the FreeBSD copyright message appear in the ia64 simulator.
2000-09-29 13:46:07 +00:00