CVS Repository/ srcgnuusr.binbinutilsbfd/ elf.c


OpenBSD release(s):
1.24 (79 78 77 76 75 74 73), 1.23 (72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57), 1.22 (56 55 54 53), 1.21 (52), 1.20 (51), 1.19 (50 49 48 47 46), 1.18 (45 44 43 42 41 40 39 38 37), 1.17 (36), 1.16 (35 34 33), 1.12 (32), 1.11 (31), 1.10 (30), 1.9 (29 28), 1.8 (27 26 25 24 23 22 21), 1.7 (20), 
Tags:
1.8 (new-binutils), 1.1.1.9 (BINUTILS-2_14), 1.1.1.8 (binutils-2_11_2), 1.1.1.7 (BINUTILS-2_10_1), 1.1.1.6 (BINUTILS-2_10), 1.1.1 (CYGNUS FSF), 1.1.1.10 (BINUTILS_2_15), 1.1.1.5 (BINUTILS-2_8_1), 1.1.1.4 (CYGNUS-961112), 1.1.1.3 (CYGNUS-960904), 1.1.1.2 (CYGNUS-960609 CYGNUS-960607), 1.1.1.1 (FSF_2_6), 
revision 1.24/ (Download) - annotate - Fri, 07 Oct 2022 15:04:51 UTC by deraadt
OpenBSD release(s): 79 78 77 76 75 74 73
Changes since 1.23: +30 -1 (diff)
In the linkers, collect objects in section "openbsd.mutable" and place
them into a page-aligned region in the bss, with the right markers for
kernel/ld.so to identify the region and skip making it immutable.
While here, fix readelf/objdump versions to show all of this.
ok miod kettenis

revision 1.23/ (Download) - annotate - Tue, 13 Jan 2015 20:05:01 UTC by kettenis
OpenBSD release(s): 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57
Changes since 1.22: +22 -8 (diff)
Generate a PT_PHDR entry for static PIE binaries.  Modern GDB needs this to
do some sanity checking while it determines the load base.

ok kurt@

revision 1.22/ (Download) - annotate - Mon, 20 Aug 2012 23:25:07 UTC by matthew
OpenBSD release(s): 56 55 54 53
Changes since 1.21: +30 -1 (diff)
Add support for .openbsd.randomdata sections and PT_OPENBSD_RANDOMIZE
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

revision 1.21/ (Download) - annotate - Thu, 12 Apr 2012 12:37:40 UTC by kettenis
OpenBSD release(s): 52
Changes since 1.20: +7 -2 (diff)
Don't munge PID and TID together, since the way GDB displays them isn't very
helpful.  Just provide the TID instead.

revision 1.20/ (Download) - annotate - Sat, 31 Dec 2011 22:44:50 UTC by kettenis
OpenBSD release(s): 51
Changes since 1.19: +5 -0 (diff)
Properly recognize threads in OpenBSD core dumps.

revision 1.19/ (Download) - annotate - Thu, 05 Mar 2009 19:41:32 UTC by kettenis
OpenBSD release(s): 50 49 48 47 46
Changes since 1.18: +69 -0 (diff)
Teach bfd and gdb about the upcoming ELF core dumps.

revision 1.18/ (Download) - annotate - Tue, 02 Nov 2004 20:45:06 UTC by miod
OpenBSD release(s): 45 44 43 42 41 40 39 38 37
Changes since 1.17: +777 -801 (diff)
Merge conflicts, bringing our changes back in:
- 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@.

revision 1.17/ (Download) - annotate - Mon, 17 May 2004 21:54:21 UTC by drahn
OpenBSD release(s): 36
Changes since 1.16: +2786 -1215 (diff)
Resolve merge conflicts, adjust method of W^X handing (.sh files)
remove testsuites (not useable) remove mmalloc (not part of new binutils).

revision 1.16/ (Download) - annotate - Thu, 30 Jan 2003 21:10:51 UTC by drahn
OpenBSD release(s): 35 34 33
Changes since 1.15: +3 -3 (diff)
Again this comment was not updated. now we have 7 load sections.

revision 1.15/ (Download) - annotate - Thu, 30 Jan 2003 21:06:47 UTC by drahn
Changes since 1.14: +1 -1 (diff)
ELF security enhancement: put .rodata into it's own load section instead
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.

revision 1.14/ (Download) - annotate - Fri, 17 Jan 2003 20:55:08 UTC by drahn
Changes since 1.13: +5 -2 (diff)
Update comment for linker change which just committed.

revision 1.13/ (Download) - annotate - Fri, 17 Jan 2003 20:50:13 UTC by drahn
Changes since 1.12: +1 -1 (diff)
This is a project to modify executables so that they do not have any
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.

revision 1.12/ (Download) - annotate - Mon, 13 May 2002 17:07:29 UTC by fgsch
OpenBSD release(s): 32
Changes since 1.11: +750 -424 (diff)
resolve conflicts.

revision 1.11/ (Download) - annotate - Tue, 02 Apr 2002 21:52:26 UTC by fgsch
OpenBSD release(s): 31
Changes since 1.10: +6 -2 (diff)
Leave space for terminating NULL if empty symbol table. from bfd-current
via pr 2447; deraadt@ ok.

revision 1.10/ (Download) - annotate - Sat, 09 Jun 2001 22:29:25 UTC by espie
OpenBSD release(s): 30
Changes since 1.9: +33 -11 (diff)
Automatic cvs merge. Dread what I will have to fix after this excuse
of a program is done...

revision 1.9/ (Download) - annotate - Tue, 12 Sep 2000 19:11:12 UTC by espie
OpenBSD release(s): 29 28
Changes since 1.8: +2345 -260 (diff)
Help stupid cvs fixing basic conflicts.

revision 1.8/ (Download) - annotate - Sat, 23 Nov 1996 03:33:02 UTC by niklas
OpenBSD release(s): 27 26 25 24 23 22 21
Tags: new-binutils
Changes since 1.7: +17 -1 (diff)
Merge to Cygnus 961112 + add some support (not ready) for shared libs

revision 1.7/ (Download) - annotate - Sat, 28 Sep 1996 22:41:42 UTC by pefo
OpenBSD release(s): 20
Changes since 1.6: +2 -2 (diff)
Need a real fix. Remove workaround...

revision 1.6/ (Download) - annotate - Sat, 28 Sep 1996 18:24:02 UTC by pefo
Changes since 1.5: +2 -2 (diff)
workaround for header bug

revision 1.5/ (Download) - annotate - Fri, 06 Sep 1996 19:28:20 UTC by pefo
Changes since 1.4: +0 -5 (diff)
Seems they fixed that old bug. Remove workaround

revision 1.4/ (Download) - annotate - Wed, 04 Sep 1996 19:00:28 UTC by niklas
Changes since 1.3: +132 -31 (diff)
Merge the Cygnus 960904 sources

revision 1.3/ (Download) - annotate - Sun, 14 Jul 1996 20:41:24 UTC by pefo
Changes since 1.2: +6 -0 (diff)
Fixes to make MIPS arc port to use in tree binutils.

revision 1.2/ (Download) - annotate - Mon, 10 Jun 1996 10:44:40 UTC by niklas
Changes since 1.1: +1083 -559 (diff)
Bring Cygnus versions into the trunk, keeping our local patches

revision 1.1/ (Download) - annotate - Mon, 08 Jan 1996 11:04:45 UTC by niklas
Branch point for: 1.1.1.1
Initial revision

revision 1.1.1.10/ (Download) - annotate - Tue, 02 Nov 2004 20:22:20 UTC by miod
Tags: BINUTILS_2_15
Changes since 1.1.1.9: +777 -801 (diff)
Binutils 2.15, with testsuites removed, and without gdb and libiberty.

revision 1.1.1.9/ (Download) - annotate - Mon, 17 May 2004 20:42:12 UTC by drahn
Tags: BINUTILS-2_14
Changes since 1.1.1.8: +2791 -1216 (diff)
import binutils 2.14 (excluding testsuites, .info files, and .po files)

revision 1.1.1.8/ (Download) - annotate - Mon, 13 May 2002 13:23:09 UTC by fgsch
Tags: binutils-2_11_2
Changes since 1.1.1.7: +750 -424 (diff)
Import binutils-2.11.2
- only the binutils package (no gdb here)
- don't import libiberty and texinfo, they are elsewhere
- remove all .info* generated files

revision 1.1.1.7/ (Download) - annotate - Sat, 09 Jun 2001 22:06:43 UTC by espie
Tags: BINUTILS-2_10_1
Changes since 1.1.1.6: +33 -11 (diff)
Long delayed import of binutils-2.10.1. Turns out art@ needs some alpha
bug-fixes...

revision 1.1.1.6/ (Download) - annotate - Tue, 12 Sep 2000 14:45:37 UTC by espie
Tags: BINUTILS-2_10
Changes since 1.1.1.5: +1684 -246 (diff)
Import binutils-2.10
- only the binutils package (no gdb here)
- don't import libiberty and texinfo, they are elsewhere
- remove all .info* generated files

revision 1.1.1.5/ (Download) - annotate - Thu, 29 May 1997 09:18:47 UTC by niklas
Tags: BINUTILS-2_8_1
Changes since 1.1.1.4: +659 -11 (diff)
Import of binutils-2.8.1 from Cygnus/FSF

revision 1.1.1.4/ (Download) - annotate - Tue, 19 Nov 1996 14:12:24 UTC by niklas
Tags: CYGNUS-961112
Changes since 1.1.1.3: +17 -1 (diff)
Import of 961112 Cygnus binutils+gas+ld+gdb+gprof

revision 1.1.1.3/ (Download) - annotate - Wed, 04 Sep 1996 17:37:41 UTC by niklas
Tags: CYGNUS-960904
Changes since 1.1.1.2: +132 -31 (diff)
Import of binutils, gas, ld & gprof from Cygnus 960904 tree

revision 1.1.1.2/ (Download) - annotate - Fri, 07 Jun 1996 11:05:31 UTC by niklas
Tags: CYGNUS-960609 CYGNUS-960607
Changes since 1.1.1.1: +1083 -559 (diff)
(Correct) Import of Cygnus binutils snapshot taken 960607

revision 1.1.1.1/ (Download) - annotate - Mon, 08 Jan 1996 11:04:45 UTC by niklas
Tags: FSF_2_6
Changes since 1.1: none
Initial GNU binutils 2.6 import