]> git.pld-linux.org Git - packages/binutils.git/blame - binutils-preserve_e_flags.patch
- md5sums, cleanups
[packages/binutils.git] / binutils-preserve_e_flags.patch
CommitLineData
7b409a90
MM
1Hmm.. This fixes problem with chpax. Should I install it to our cvs or
2we're downgrading?
3
4[slightly modifed for our version]
5
6----- Forwarded message from "H . J . Lu" <hjl@lucon.org> -----
7
8Date: Sat, 15 Dec 2001 16:20:17 -0800
9From: "H . J . Lu" <hjl@lucon.org>
10To: Michal Moskal <malekith@pld.org.pl>
11Cc: binutils@sourceware.cygnus.com
12Subject: PATCH: Preserve e_flags.
13User-Agent: Mutt/1.2.5i
14X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/)
15X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/)
16
17On Sat, Dec 15, 2001 at 10:11:35AM -0800, H . J . Lu wrote:
18> On Tue, Dec 11, 2001 at 03:53:20PM +0100, Michal Moskal wrote:
19> > chpax is simple utility to be used with openwall linux kernel patch.
20> > The patch disallows certain things, but some programs still need it.
21> > chpax is used to set certain flags in elf file (e_flags field, PAGE_EXEC
22> > is for instance 0x01).
23> > (sorry if you already knew that... :)
24> >
25> > And now the problem is that objcopy (and strip), does not copy e_flags
26> > from one elf file to another.
27> >
28>
29
30Here is a patch. Shouldn't we preserve e_flags?
31
32
33
34H.J.
35---
362001-12-15 H.J. Lu <hjl@gnu.org>
37
38 * elf-bfd.h (_bfd_elf_copy_private_bfd_data): New. Prototype.
39
40 * elf.c (_bfd_elf_copy_private_bfd_data): New. Copy e_flags in
41 the ELF header.
42
43 * elfxx-target.h (bfd_elfNN_bfd_copy_private_bfd_data): Defined
44 to _bfd_elf_copy_private_bfd_data.
45
46--- bfd/elf-bfd.h Wed May 23 20:36:02 2001
47+++ bfd/elf-bfd.h Sat Dec 29 17:50:17 2001
48@@ -979,6 +979,7 @@
49 PARAMS ((bfd *, unsigned, unsigned));
50 extern char *bfd_elf_get_str_section PARAMS ((bfd *, unsigned));
51
52+extern boolean _bfd_elf_copy_private_bfd_data PARAMS ((bfd *, bfd *));
53 extern boolean _bfd_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
54 extern void bfd_elf_print_symbol PARAMS ((bfd *, PTR, asymbol *,
55 bfd_print_symbol_type));
56--- bfd/elf.c.header Sat Dec 15 16:08:37 2001
57+++ bfd/elf.c Sat Dec 15 16:07:02 2001
58@@ -782,6 +782,24 @@ _bfd_elf_merge_sections (abfd, info)
59 /* Print out the program headers. */
60
61 boolean
62+_bfd_elf_copy_private_bfd_data (ibfd, obfd)
63+ bfd *ibfd;
64+ bfd *obfd;
65+{
66+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
67+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
68+ return true;
69+
70+ BFD_ASSERT (!elf_flags_init (obfd)
71+ || (elf_elfheader (obfd)->e_flags
72+ == elf_elfheader (ibfd)->e_flags));
73+
74+ elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
75+ elf_flags_init (obfd) = true;
76+ return true;
77+}
78+
79+boolean
80 _bfd_elf_print_private_bfd_data (abfd, farg)
81 bfd *abfd;
82 PTR farg;
83--- bfd/elfxx-target.h.header Thu Nov 15 10:18:25 2001
84+++ bfd/elfxx-target.h Sat Dec 15 16:10:11 2001
85@@ -142,7 +142,7 @@ Foundation, Inc., 59 Temple Place - Suit
86 #endif
87 #ifndef bfd_elfNN_bfd_copy_private_bfd_data
88 #define bfd_elfNN_bfd_copy_private_bfd_data \
89- ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true)
90+ _bfd_elf_copy_private_bfd_data
91 #endif
92 #ifndef bfd_elfNN_bfd_print_private_bfd_data
93 #define bfd_elfNN_bfd_print_private_bfd_data \
94
95----- End forwarded message -----
This page took 0.067584 seconds and 4 git commands to generate.