summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/binutils/ld (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change gcc and ld semantics to make static PIE the default when invokingpascal2015-04-021-2/+0
| | | | | | | | 'cc -static'. To explicitly request the legacy behaviour, use -nopie. For the few port affected by this, bumps will follow shortly. looks good to kettenis@, ok kurt@
* self-relocating crt0 bits for sh, and enable static pie by default. With somemiod2014-12-301-1/+1
| | | | archdep.h help from kettenis@
* Change the default entry point from _start to __start.kettenis2014-12-271-0/+1
| | | | ok kurt@, guenther@
* Teach ld(1) not to add a PT_INTERP entry for -static -pie.kettenis2014-12-221-0/+3
| | | | ok kurt@
* Backport @file support from binutils-2.17tobiasu2014-08-311-0/+2
| | | | | | | @file allows reading command line arguments from a file. Gcc now uses this to pass very long arguments lists to ld. ok guenther@ miod@
* We don't use the __openbsd_randomdata_{start,end} symbols, but ratherguenther2014-08-091-4/+0
| | | | | | | | get that info via the PT_OPENBSD_RANDOM segment info, so kill the symbols While here, delete the commented out lines for __DYNAMIC as the question they ask is answered 'no' ok matthew@ back in May
* Recognize PT_OPENBSD_RANDOMIZE in linker scripts.kettenis2013-12-301-0/+2
| | | | ok miod@, matthew@
* Make stderr buffered in einfo(). Speeds up display of error messagesmillert2013-09-301-0/+4
| | | | on slower platforms. Idea from espie@, OK espie@ deraadt@ guenther@
* VAX ELF toolchain, using `%' as the register prefix. Heavily based uponmiod2013-07-054-0/+14
| | | | NetBSD.
* Crank MAXPAGESIZE from 4KB to 64KB to match what SVR4/m88k and DG/UX do.miod2013-04-171-1/+1
|
* Disable PIE-by-default if -static (or one of its aliases) is passed on thekettenis2013-02-051-0/+2
| | | | | | | | command line. While technically -static only controls whether we link against static libraries, people expect that doing so produces a fully static binary. tested by sthen@ ok pascal@, miod@
* ELF toolchain for m68k, following the SysV/m68k ABI (32-bit types aligned onmiod2013-02-024-1/+18
| | | | | | | | 32-bit boundaries, function return values being in %a0 instead of %d0 if they are declared as pointers, and in fp registers if they are floating point types). Compiler configuration bits (including a few m68k PIC code generation fixes) borrowed from NetBSD.
* Generate linker scripts for shared libraries. Force padding sections aroundmiod2013-01-201-1/+3
| | | | plt, because it may need to be written to during initial relocation.
* m88k ELF toolchain, supporting static binaries only so far.miod2013-01-016-1/+51
| | | | | | | | | | | | | | | | | | Assembler supports a register prefix of `#' when configured for SVR4, and `%' when configured for OpenBSD. Pseudo-ops do not need a leading dot, except when configured for OpenBSD, allowing the `set' instruction to be recognized correctly. Based upon various unfinished or unreliable works, including smurph@'s early work in 2003, my own attempts in 2004 and 2005, and Michael Kato's binutils 2.15 diff from 2005. Support for register prefixes, as well as fixing an evil off-by-one in resolving 16-bit pc-relative relocations in ld (which would only affect kernel .S files branching to global symbols), came as part of the 2012 work. Not enabled yet (needs Makefile.bsd-wrapper, bfd/config.bfd and gdb/configure.tgt updates to completely enable) so as not to disturb the existing a.out toolchain builds; will hopefully be enabled very soon.
* Add support for PIE-by-default in both ld and gcc. This is a completelypascal2012-08-282-0/+25
| | | | | | | | | | different approach than the one taken in kurt@'s original diff, but deemed better after discussion and diff exchange with kettenis@ and matthew@. Lots of feedback by kettenis@ and matthew@, prodding and encouragement by deraadt@. ok kettenis@ matthew@
* Add support for .openbsd.randomdata sections and PT_OPENBSD_RANDOMIZEmatthew2012-08-201-0/+7
| | | | | | | | segments to the kernel, ld (2.15), and ld.so. Tested on alpha, amd64, i386, macppc, and sparc64 (thanks naddy, mpi, and okan!). Idea discussed for some time; committing now for further testing. ok deraadt
* Fixup ldscripts for i386 when linked with -pie (no change to non-piekurt2008-06-134-6/+36
| | | | | | ldscripts). Correct the xd and xdc ldscripts (pie and pie + combreloc) on i386 and add two new variants for pie + combreloc + Z and pie + Z on all arches. ok drahn@
* Add __data_start symbol to all ELF archs to consistently mark the beginningkurt2008-03-134-1/+6
| | | | | | of the writable sections. This is useful for garbage collectors such as boehm-gc to locate these sections in a uniform way. input and okay drahn@, miod@
* Define superH obsd-specific emulations for ld, and use it by default.miod2006-10-085-1/+50
|
* Early bits for a 32-bit SuperH toolchain, currently for little-endianmiod2006-10-061-1/+1
| | | | systems only; more work is necessary in ld land.
* Don't free pathname after successfull _try_needed call; it's cached in thatkettenis2005-12-111-1/+0
| | | | | case. Fixes "could not read symbols: File truncated" problems. ok deraadt@
* Provide openbsd emulation for mips64el as we do for mips64.grange2005-01-194-1/+17
| | | | ok miod@
* Regenerate.kettenis2005-01-151-1/+1
|
* Invoke config.sub using the shell.kettenis2005-01-151-1/+1
| | | | ok drahn@
* Partially revert to binutils 2.14: do not put a ``warning: '' prefixmiod2004-11-081-8/+3
| | | | | to stabs warning messages, as we already provide it in the message. This will not change until all our supported architectures move to ELF.
* we use our own ways to install manual pages, not their tree traversalsderaadt2004-11-031-1/+1
| | | | which dump junk all over the place. pval miod ok
* Merge glitches.miod2004-11-021-0/+6
|
* Merge conflicts, bringing our changes back in:miod2004-11-0260-11381/+4480
| | | | | | | | | | | | | | | | | | | | | - extra $(SHELL) and sugar for make (so that files not mode +x still work) - safer temp file handling - our W^X binary layout changes in ld - OpenBSD policy for library file selection in ld - arm and m88k changes which were not merged in time for official 2.15 - bfd core file handling - a couple typos New for 2.15: - ld(1) and as(1) manpages now generated at build time - binutils/stabs.c reverted to use our in-tree libiberty for now - we still use our VIA C3 crypto code over stock binutils, as it recognizes more instructions - new emulations for OpenBSD on mips64 machines, to help OpenBSD/sgi - relaxed %f# handling in gas on OpenBSD/sparc64 (same as was in 2.14) Tested on all platforms by various people; special thanks to sturm@ and otto@.
* Binutils 2.15, with testsuites removed, and without gdb and libiberty.miod2004-11-0296-1829/+18552
|
* Lookup libraries based on version numbers for implicit as well explict librariesdrahn2004-10-081-6/+137
| | | | ok espie@
* eliminate portion for 3.2, there was no 3.2 release.brad2004-07-311-6/+0
| | | | ok mickey@
* emacs undump is very sensative to the section ordering, For W^X a coupledrahn2004-05-303-7/+18
| | | | | | | of sections were moved for protections purposes. This causes problems with emacs undump. Only move the sections if the W^X padding is active. Generate the scripts properly for newer binutils, on i386 if -Z is active, move the executable start address back to the classic base address.
* provide a way data plt prepending got; drahn@ okmickey2004-05-252-2/+3
|
* remove the disabled DO_FORCE_VERS support.brad2004-05-191-35/+1
| | | | ok drahn@
* Resolve merge conflicts, adjust method of W^X handing (.sh files)drahn2004-05-17245-20914/+16126
| | | | remove testsuites (not useable) remove mmalloc (not part of new binutils).
* import binutils 2.14 (excluding testsuites, .info files, and .po files)drahn2004-05-17224-1914/+11328
|
* configs for amd64; brad@ okmickey2004-02-102-0/+12
|
* If gld${EMULATION_NAME}_search_dir() returns NULL, return earlysturm2003-11-231-0/+2
| | | | | | and try not to fopen(NULL, ...) later. ok millert@
* powerpc ld.so has a slightly unreasonable expectation about __got_startdrahn2003-09-201-2/+2
| | | | and the location of the GOT. reorder GOT and the CTOR/DTOR section.
* Make CTORS/DTORS non-writeable in dynamic binaries. ok deraadt@drahn2003-09-191-3/+3
|
* Document -Z flag for ld, produce old style 'standard' executables'. ok deraadt@drahn2003-07-201-0/+6
|
* somehow duplicate lines had gotten in theremickey2003-06-021-3/+0
|
* Move exec base to 0x1c000000, exe/data gap to 512MB. Allows betterdrahn2003-05-051-2/+2
| | | | | interleave of exe/shared libs. Raise MAXDSIZ back to 1G. This change REQUIRES a binary update on i386.
* Switch i386 to new binutils, i386 tools now do ELF.drahn2003-04-178-7/+26
| | | | | | RODATA_* align macros to preserve current behavior on other archs and allow for 1G sep between beginning of exe and beginning of data DARPA funded work.
* fix bad entry definitionmickey2003-04-091-1/+1
|
* use common elf.sc instead of own hppaobsd.sc, catch up w/ dale's elf work for hppa; drahn@ lots of helps and okmickey2003-02-064-37/+5
|
* ELF security enhancement: put .rodata into it's own load section insteaddrahn2003-01-306-0/+7
| | | | | | | | of putting it with the text. This removes the execute permission from readonly data. This constrains the executable region to portions of the executable which need to be executable. Note: not all processors or mmus are capable of -X protection at the page level, but should handle ELF images which specify specific RWX protections on each section.
* This is a project to modify executables so that they do not have anydrahn2003-01-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | executable regions which are writable. If a section of an executable is writable and executable, it is much easier for errant code to modify the executable's behavior. Two current areas in shared library environments which have this critical problem are the GOT (Global Offset Table) and PLT (Procedure Linkage Table). The PLT is required to be executable and both GOT and PLT are writable on most architectures. On most ELF architecture machines this would cause shared libraries to have data and BSS marked as executable. Padding to the linker script for programs and shared libraries/objects to isolate the GOT and PLT into their own load sections in the executables. This allows only the text(readonly) region and the PLT region to be marked executable with the normal data and BSS not marked as executable. The PLT region is still marked executable on most architectures because the PLT lives in the "data" or "BSS" regions and the dynamic loader will need to modify it. Since the GOT and PLT should only ever be written by the dynamic linker, it will be modified to mprotect those regions so that they are not writable during normal execution. If the dynamic linker needs to modify the regions later, (eg for lazy binding), it will mprotect the region, make the necessary changes, and mprotect it back. Since it is possible to receive a signal which would interrupt the program flow and perhaps cause the dynamic linker to modify the same (or nearby) PLT references, it is now necessary for signals to be blocked for the duration of the mprotect. This diff was omitted from the original commit, this implements the -Z option to produce traditional (non protected) executables.
* This is a project to modify executables so that they do not have anydrahn2003-01-1710-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | executable regions which are writable. If a section of an executable is writable and executable, it is much easier for errant code to modify the executable's behavior. Two current areas in shared library environments which have this critical problem are the GOT (Global Offset Table) and PLT (Procedure Linkage Table). The PLT is required to be executable and both GOT and PLT are writable on most architectures. On most ELF architecture machines this would cause shared libraries to have data and BSS marked as executable. Padding to the linker script for programs and shared libraries/objects to isolate the GOT and PLT into their own load sections in the executables. This allows only the text(readonly) region and the PLT region to be marked executable with the normal data and BSS not marked as executable. The PLT region is still marked executable on most architectures because the PLT lives in the "data" or "BSS" regions and the dynamic loader will need to modify it. Since the GOT and PLT should only ever be written by the dynamic linker, it will be modified to mprotect those regions so that they are not writable during normal execution. If the dynamic linker needs to modify the regions later, (eg for lazy binding), it will mprotect the region, make the necessary changes, and mprotect it back. Since it is possible to receive a signal which would interrupt the program flow and perhaps cause the dynamic linker to modify the same (or nearby) PLT references, it is now necessary for signals to be blocked for the duration of the mprotect.
* Add a compatibilty flag '-Z' for upcoming elf changes, does nothing currentlydrahn2003-01-131-0/+6
| | | | but will produce old style executables when the other changes appear.