Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elfix:master commit in: src/
Date: Fri, 27 Jul 2012 22:00:19
Message-Id: 1343426239.b3e9ab5db62e344bfe72b78c6ab7fcfebf6d9592.blueness@gentoo
1 commit: b3e9ab5db62e344bfe72b78c6ab7fcfebf6d9592
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 27 21:57:19 2012 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 27 21:57:19 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=b3e9ab5d
7
8 Revert "src/{fix-gnustack.c,paxctl-ng.c}: ELF_C_RDWR_MMAP -> ELF_C_RDWR for uclibc compat"
9
10 This reverts commit 02640d9d23cc4736e642600430b13406c33dba9e.
11
12 Using libelf instead of elfutils to gelf_update_phdr() fails. Revert
13 for now until we figure out what's going on.
14
15 ---
16 src/fix-gnustack.c | 2 +-
17 src/paxctl-ng.c | 4 ++--
18 2 files changed, 3 insertions(+), 3 deletions(-)
19
20 diff --git a/src/fix-gnustack.c b/src/fix-gnustack.c
21 index 03da236..15e23e0 100644
22 --- a/src/fix-gnustack.c
23 +++ b/src/fix-gnustack.c
24 @@ -99,7 +99,7 @@ main( int argc, char *argv[])
25 {
26 if((fd = open(f_name, O_RDWR)) < 0)
27 error(EXIT_FAILURE, 0, "open() fail.");
28 - if((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL)
29 + if((elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL)) == NULL)
30 error(EXIT_FAILURE, 0, "elf_begin() fail: %s", elf_errmsg(elf_errno()));
31 }
32 else
33
34 diff --git a/src/paxctl-ng.c b/src/paxctl-ng.c
35 index 4b7e6fb..025ea24 100644
36 --- a/src/paxctl-ng.c
37 +++ b/src/paxctl-ng.c
38 @@ -216,7 +216,7 @@ get_pt_flags(int fd, int verbose)
39 return pt_flags;
40 }
41
42 - if((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL)
43 + if((elf = elf_begin(fd, ELF_C_READ_MMAP, NULL)) == NULL)
44 {
45 if(verbose)
46 printf("\tELF ERROR: elf_begin() fail: %s\n", elf_errmsg(elf_errno()));
47 @@ -460,7 +460,7 @@ set_pt_flags(int fd, uint16_t pt_flags, int verbose)
48 return;
49 }
50
51 - if((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL)
52 + if((elf = elf_begin(fd, ELF_C_RDWR_MMAP, NULL)) == NULL)
53 {
54 if(verbose)
55 printf("\tELF ERROR: elf_begin() fail: %s\n", elf_errmsg(elf_errno()));