Age | Commit message (Collapse) | Author |
|
The original reason was some corner cases around COPY relocations, which
caused problems for miniperl which directly modified environ and accessed
environ via libc functions.
This causes duplicate symbols for environ/__progname in some (poorly written)
apps, but is allowed on most other architectures.
Since the time this was added other arm architecture changes mean that we
don't need it, so remove it.
debugged with kettenis@ and jca@
tested and OK guenther@
|
|
|
|
|
|
reproducing the relevant defines and code in a different place) to perform
minor relocations. If things go very wrong, it would call _dl_exit() --
a locally defined crt0 function which is syscall exit(2). We don't need
to call exit(2) for this obscure case which doesn't happen and provides no
debugging information. An 'abort' is going to provide better information.
So let's change the function name to _dso_abort() and make it a single
illegal instruction.
ok guenther
|
|
current code which has a local _eprol label in the inline asm and a
global _eprol declaration results in an incorrect relocation. This
also removes an unnecessary relocation on hppa (and possible on
other architectures as well).
ok guenther@
|
|
a fully IBT userland operational..
|
|
this function is at the start of the section, there is no poing in potentially
stuffing nops into the sequence if things go wrong, it is better to fail hard.
ok guenther
|
|
ok deraadt@
|
|
also perform mimmutable()
ok guenther
|
|
here.
ok kettenis
|
|
we can verify at build time. Track dt_pltgot as an Elf_Addr instead
of an Elf_Addr* to eliminat casts on both setting and using. Set
RELATIVE_RELOC so the ld.so Makefile can verify that it has just
the relocation types we expect.
Nothing depends on archdep.h pulling in other #includes anymore, so delete
the #includes and hide the RELOC_* functions that are only used by lib/csu
behind "#ifdef RCRT0"
Tested with full build.
|
|
Prep for dropping #includes from archdep.h: pull in <machine/reloc.h>
and declare _dl_exit() in boot*.h
ok kettenis@
|
|
Fixes behavior with current clang, which marks the symbol as GLOBAL
instead of WEAK. LLVM change: https://reviews.llvm.org/D90108
base-gcc is unaffected. Keep asm(".weak") for gcc3 until a cleanup can
be tested there.
Initial diff from mortimer@, input and ok kettenis@, ok guenther@
|
|
only initializing the variables we need to, and switching to a
"while < end-of-array" style for DT_REL/RELA processing
ok drahn@ kettenis@
|
|
split ld.so/boot.c in 2019:
* delete extraneous #includes
* delete jmprel handling on non-hppa
* delete RELOC_GOT() and DT_PROC bits on non-mips64
ok visa@
|
|
ok mlarkin@
|
|
correctly and do not overwrite it in csu.
allows most ld.so regressions to pass
confirmed by jsg@, ok kettenis
|
|
Includes fixes pointed out by kettenis, jsg, naddy
|
|
OK deraadt@
|
|
("permanently undefined")
ok deraadt@ kettenis@
|
|
some of these functions were returning. That makes the +1word address
a fairly strong and easily located gadget. Put a hard-trap
instruction after the syscall. This remains a gadget for 'terminal
system' calls (such as execve), but hey that's why we have pledge w/o
"exec" throughout the tree.
Quite surprisingly, hppa's delay-slot load of SYS_exit makes it the
safest of the bunch, not that this helps anyone.
ok kettenis
|
|
the 0x400 %g2 syscall method
ok kettenis
|
|
ok kettenis
|
|
ok patrick@, drahn@
|
|
|
|
This probably should be backed out after fully debugged, vector
instructions caused problems with debug configuration.
|
|
Determine location of toc based on PC relative location and load into %r2
|
|
calls to libc in the process boot code that might not work before things
like the GOT are set up.
Suggested by deraadt@ ok visa@
|
|
problems as 64-bit models. To resolve the syscall speculation, as a first
step "nop; nop" was added after all occurances of the syscall ("swi 0")
instruction. Then the kernel was changed to jump over the 2 extra instructions.
In this final step, those pair of nops are converted into the speculation-blocking
sequence ("dsb nsh; isb").
Don't try to build through these multiple steps, use a snapshot instead.
Packages matching the new ABI will be out in a while...
ok kettenis
|
|
problems as 64-bit models. For the syscall instruction issue, add nop;nop
after swi 0, in preparation for jumping over a speculation barrier here later.
|
|
a syscall, replace the double nop with a dsb nsh; isb; sequence which
stops the CPU from speculating any further. This fix was suggested
by Anthony Steinhauser.
ok deraadt@
|
|
The will be replaced by a speculation barrier as soon as we teach the
kernel to skip over these two instructions when returning from a
system call.
ok patrick@, deraadt@
|
|
ok visa@
|
|
stop building the csu code with -fpie on that platform.
ok guenther@, visa@
|
|
- put functions and data which are only used before calling the executable's
start function into their own page-aligned segments for unmapping
(only done on amd64, arm64, armv7, powerpc, and sparc64 so far)
- pass .init_array and .preinit_array functions an addition argument which
is a callback to get a structure which includes a function that frees
the boot text and data
- sometimes delay doing RELRO processing: for a shared-object marked
DF_1_INITFIRST do it after the object's .init_array, for the executable
do it after the .preinit_array
- improve test-ld.so to link against libpthread and trigger its initialization
late
libc changes to use this will come later
ok kettenis@
|
|
executables the TIB and __progname are set up before they can be used.
problem noted by ori@
ok millert@ kettenis@
|
|
The assembler does not handle undeclared local symbols properly
and generates R_MIPS_CALL16 relocations where it should generate
local GOT references. For now, get along with the problem by
declaring local symbols where necessary.
OK kettenis@ guenther@
|
|
on mips64. They need relocation and consequently cannot be used
in that function.
OK kettenis@
|
|
to make clang happier.
No binary change with gas.
|
|
As of usr.bin/xinstall/install.c revision 1.68, -S is a no-op and
install(1) will always create files safely, thus clean the option usage
from the tree.
Diff from Lauri Tirkkonen <lotheac at iki dot fi>, thanks.
|
|
declared static.
OK guenther@
|
|
ok kettenis@
|
|
relocation of ld.so's GOT without using it, so _reloc_alpha_got()
merely made the call to _dl_boot_bind() from asm simpler...while
itself being a call that required special handling.
diff and muild baking by miod@
ok guenther@
|
|
That part is not needed with a PIE toolchain, but until gcc 4 on m88k
receives enough fixes to produce as good code as gcc 3, the bits in
r1.5 are still required.
This fixes miniperl does not work correctly while building perl on m88k.
Diff is suggested by Miod Vallat, tested by him and me, ok guenther@
|
|
not the address of its GOT entry. The current code mixed the high bits of
the GOT entry address with the low bits of the true address. This only
worked by accident for small binaries where _DYNAMIC and its GOT entry
happen to reside on the same page.
ok guenther@, mortimer@
|
|
Convert __cerror to hidden visibility.
from miod@
|
|
problem noted by deraadt@
ok espie@
|
|
ok kettenis@
|
|
okay millert@
|
|
implementations.
ok guenther@
|