martin
115160e654
Fix a few bounds and instruction sequences generated in the PLT; exercised
...
by ASLR and verified to work with the aslr fixed random debug sysctls.
2016-06-20 08:12:25 +00:00
christos
4910b5ce72
Move relro after we've computed out relocbase and re-enable it.
...
(Matthias Weckbecker)
2016-06-16 11:34:13 +00:00
christos
3ee1ef9906
Turn off GNU_RELRO for now.
2016-06-15 12:08:47 +00:00
christos
0e6265fc35
Add support for GNU RELRO headers from Matthias Weckbecker.
2016-06-14 13:06:41 +00:00
christos
564475388a
Put the name of the dynamic linker in allocated memory, so that it becomes
...
part of the core file link-map, so that gdb can find it.
2016-05-24 20:32:33 +00:00
joerg
6e49b77769
obj->phdr must be the absolute address, not the virtual offset from the
...
main binary. Historically, this has been the same. For PIE though,
relocbase can be pretty much anywhere. Fixes PR toolchain/51159.
2016-05-22 19:28:39 +00:00
skrll
42fe483061
Remove duplicated __RCSIDs I added years ago - I blame CVS.
...
Spotted by Miod Vallat
2016-04-14 20:17:07 +00:00
christos
80c3d4eb2a
- Print a warning for text relocations
...
- Don't remap the text segment executable while relocating
2016-04-12 19:10:48 +00:00
christos
80fa2ce1a5
where is already void *
2016-02-20 15:20:23 +00:00
macallan
3709f36323
make debug code compile again
...
from christos
2016-02-19 22:09:09 +00:00
skrll
19b4c45621
Actually, descsz should not contain the padding. The note still needs to
...
be padded out.
2016-02-09 10:20:03 +00:00
skrll
a5b645efc7
Fix .note.netbsd.march by ensuring correct padding
2016-02-08 11:59:39 +00:00
christos
a21e664447
we don't need <sys/mbuf.h>
2016-01-24 01:56:04 +00:00
christos
ffeb8dbf4e
Define _KERNTYPES for things that need it.
2016-01-23 21:22:45 +00:00
joerg
3490cc6261
Add an explicit note about the search path used by dlopen(3).
2015-07-03 10:19:29 +00:00
yamt
b549d229c6
Fix membars around rtld internal mutex.
...
This fixes the most of lockups i observed with Open vSwitch
on NetBSD/amd64. ("most of" because it still occasionally
locks up because of other problems. see PR/49816)
2015-04-06 09:34:15 +00:00
joerg
e0985a06ba
lib/49813: Release mutex on error.
2015-04-04 18:51:57 +00:00
matt
32b939b05c
Update RISCV to use the ELF relocations and new ABI.
2015-03-27 23:14:53 +00:00
skrll
70289840ad
HPPA hack for a problem where gdb doesn't see _rtld_debug_state when
...
it's a single bv,n %r0(%rp) instruction.
The nullify confuses something.
2015-03-05 09:49:53 +00:00
chs
a60c43758e
fix powerpc TLS problems by removing the hacks for PPC EABI.
...
the kernel no longer treats R2 specially and its use as
the TLS register is now handled entirely in userland.
2014-12-14 23:49:17 +00:00
martin
2782e828f4
Avoid use after free, reported by the coverity scanner.
2014-10-30 07:53:41 +00:00
matt
463829e46a
RISC-V support.
2014-09-19 17:43:33 +00:00
matt
6cf6fe02a9
New files for Userland support of UCB RISC-V (both 32-bit and 64-bit)
2014-09-19 17:36:24 +00:00
matt
27620987b8
New files for OR1K support
2014-09-03 19:34:25 +00:00
matt
00cc626e2f
OR1K support
2014-09-03 19:31:32 +00:00
joerg
e4cd9bc4a2
Remove (now duplicated) target computation.
2014-08-31 20:06:22 +00:00
christos
94e1a89978
remove unused define
2014-08-27 04:07:04 +00:00
joerg
c1a71e8076
Restore parenthesis to cast in the right order.
2014-08-26 21:20:05 +00:00
joerg
b88be9f652
Replace casts in the inline version of _rtld_call_function_void of
...
_rtld_call_function_addr with ifdef on RTLD_LOADER.
2014-08-26 19:49:33 +00:00
christos
db25848c17
fix set but not used.
2014-08-26 15:06:50 +00:00
joerg
5d06599748
Go back to skipping init/fini handling for ldd, makes problems for 32bit
...
compat on LP64.
2014-08-26 12:14:14 +00:00
christos
d9972a4666
Introduce a cast to fix the build for Elf32 on _LP64.
2014-08-26 07:54:27 +00:00
joerg
7a1a6f1cf3
Add basic support for indirect functions. It allows providing a public
...
function symbol with an implementation choosen at run time.
Refactor calls to functions by address in ld.elf_so to create temporary
function descriptors on the stack, if the address is not leaked outside.
Limitations:
- no support for initialising static storage with function pointers
- no support for unnamed resolver functions
Inspired by FreeBSD's r228435 by kib@freebsd.org .
2014-08-25 20:40:52 +00:00
joerg
f5cd842d49
Outdated, kill.
2014-08-23 19:18:41 +00:00
joerg
6a83645936
Typo.
2014-08-23 18:05:33 +00:00
matt
5b3354816c
Add proper registers for register counts.
2014-08-17 16:57:37 +00:00
matt
d32bdc3217
add a missing register prefix.
2014-08-17 16:14:19 +00:00
matt
30993f706c
Use -fPIC since powerpc64 is always compiled as -fPIC and -fpic would cause
...
__PIC__ to change.
2014-08-15 09:40:07 +00:00
joerg
8a961968a8
Build position independent on PPC64, too.
2014-08-13 15:56:52 +00:00
matt
243b0ccea7
Don't provide __gnu_Unwind_Find_exidx if __ARM_DWARF_EH__ is defined
2014-08-10 23:35:26 +00:00
matt
547b3a3b01
Changes to existing files to enable building AARCH64 userland.
...
evbarm64-el
This is clang only. While gcc4.8 supports aarch64, no netbsd support has
been written for aarch64 with gcc4.8.
2014-08-10 05:56:36 +00:00
matt
beb9c6d1b5
Preliminary files for AARCH64 (64-bit ARM) support.
...
Enough for a distribution build.
2014-08-10 05:47:35 +00:00
matt
154c7bc749
Fix parenthesis on __ha macro
2014-07-28 17:28:13 +00:00
martin
b87a9303be
The table of masks applied for each relocation type was wrong for some
...
relocs with 64bit targets, like GLOB_DAT.
Change some instruction patterns used for PLT slots, so -current
objdump -d shows what the comment says.
Fix encoding of %lox() in PLT slots "close" to -1.
Enhance debug output slightly.
2014-04-02 14:11:25 +00:00
matt
a1f21652d9
Make sure r1 is preserved _rtld_bind_start.
2014-03-22 15:13:10 +00:00
matt
e26b436cdb
Simplify. If we got called via a calls $n, *pcrel32, instead of constructing
...
a new stack frame, back up the PC by 7 and return back to the calls so it
will be reinvoked. (This is by far the most common way it gets invoked).
Otherwise rebuild a new callframe and jump to the routine.
2014-03-21 14:03:30 +00:00
matt
bc069d405c
Improve some of the rdbg messages to print the address of the pltgot slot
...
being modified.
2014-03-21 01:43:33 +00:00
matt
22fbc67ed0
Don't resolve symbols to PLT entries on the VAX. It just causes a lot of
...
overhead.
2014-03-21 01:40:41 +00:00
joerg
f8bf5bbce0
Save actual start of function, not address of entry mask on the stack.
2014-03-19 21:52:00 +00:00
matt
f71aaf7afb
Fix two bugs. (jump past entry mask, fix insv)
2014-03-19 15:34:30 +00:00