Blame SOURCES/Add-PL_ARCH-for-AArch64.patch

6e5fae
From a33b23b9ec5c0733a0ff85dafc46b3df2a6d2249 Mon Sep 17 00:00:00 2001
6e5fae
From: Mark Salter <msalter@redhat.com>
6e5fae
Date: Fri, 21 Aug 2015 12:03:30 -0400
6e5fae
Subject: [PATCH] Add PL_ARCH for AArch64
6e5fae
6e5fae
Add a skeleton PL_ARCH for AArch64. Just enough to support
6e5fae
execstack.
6e5fae
6e5fae
Signed-off-by: Mark Salter <msalter@redhat.com>
6e5fae
---
6e5fae
 src/Makefile.am    |  3 ++-
6e5fae
 src/Makefile.in    |  9 ++++++---
6e5fae
 src/arch-aarch64.c | 38 ++++++++++++++++++++++++++++++++++++++
6e5fae
 3 files changed, 46 insertions(+), 4 deletions(-)
6e5fae
 create mode 100644 src/arch-aarch64.c
6e5fae
6e5fae
diff --git a/src/Makefile.am b/src/Makefile.am
6e5fae
index d2265aa9c0..a4c65f2e65 100644
6e5fae
--- a/src/Makefile.am
6e5fae
+++ b/src/Makefile.am
6e5fae
@@ -12,7 +12,8 @@ bin_PROGRAMS = execstack
6e5fae
 
6e5fae
 arch_SOURCES = arch-i386.c arch-alpha.c arch-ppc.c arch-ppc64.c \
6e5fae
 	       arch-sparc.c arch-sparc64.c arch-x86_64.c arch-mips.c \
6e5fae
-	       arch-s390.c arch-s390x.c arch-arm.c arch-sh.c arch-ia64.c
6e5fae
+	       arch-s390.c arch-s390x.c arch-arm.c arch-sh.c arch-ia64.c \
6e5fae
+	       arch-aarch64.c
6e5fae
 common_SOURCES = checksum.c data.c dso.c dwarf2.c dwarf2.h fptr.c fptr.h     \
6e5fae
 		 hashtab.c hashtab.h mdebug.c prelink.h stabs.c crc32.c
6e5fae
 prelink_SOURCES = cache.c conflict.c cxx.c doit.c exec.c execle_open.c get.c \
6e5fae
diff --git a/src/Makefile.in b/src/Makefile.in
6e5fae
index 85cf84577f..863dc835a0 100644
6e5fae
--- a/src/Makefile.in
6e5fae
+++ b/src/Makefile.in
6e5fae
@@ -107,7 +107,8 @@ bin_PROGRAMS = execstack
6e5fae
 
6e5fae
 arch_SOURCES = arch-i386.c arch-alpha.c arch-ppc.c arch-ppc64.c \
6e5fae
 	       arch-sparc.c arch-sparc64.c arch-x86_64.c arch-mips.c \
6e5fae
-	       arch-s390.c arch-s390x.c arch-arm.c arch-sh.c arch-ia64.c
6e5fae
+	       arch-s390.c arch-s390x.c arch-arm.c arch-sh.c arch-ia64.c \
6e5fae
+	       arch-aarch64.c
6e5fae
 
6e5fae
 common_SOURCES = checksum.c data.c dso.c dwarf2.c dwarf2.h fptr.c fptr.h     \
6e5fae
 		 hashtab.c hashtab.h mdebug.c prelink.h stabs.c crc32.c
6e5fae
@@ -139,7 +140,8 @@ am__objects_2 = arch-i386.$(OBJEXT) arch-alpha.$(OBJEXT) \
6e5fae
 	arch-ppc.$(OBJEXT) arch-ppc64.$(OBJEXT) arch-sparc.$(OBJEXT) \
6e5fae
 	arch-sparc64.$(OBJEXT) arch-x86_64.$(OBJEXT) \
6e5fae
 	arch-mips.$(OBJEXT) arch-s390.$(OBJEXT) arch-s390x.$(OBJEXT) \
6e5fae
-	arch-arm.$(OBJEXT) arch-sh.$(OBJEXT) arch-ia64.$(OBJEXT)
6e5fae
+	arch-arm.$(OBJEXT) arch-sh.$(OBJEXT) arch-ia64.$(OBJEXT) \
6e5fae
+	arch-aarch64.$(OBJEXT)
6e5fae
 am_execstack_OBJECTS = execstack.$(OBJEXT) $(am__objects_1) \
6e5fae
 	$(am__objects_2)
6e5fae
 execstack_OBJECTS = $(am_execstack_OBJECTS)
6e5fae
@@ -162,7 +164,7 @@ LIBS = @LIBS@
6e5fae
 depcomp = $(SHELL) $(top_srcdir)/depcomp
6e5fae
 am__depfiles_maybe = depfiles
6e5fae
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/arch-alpha.Po \
6e5fae
-@AMDEP_TRUE@	./$(DEPDIR)/arch-arm.Po ./$(DEPDIR)/arch-i386.Po \
6e5fae
+@AMDEP_TRUE@	./$(DEPDIR)/arch-arm.Po ./$(DEPDIR)/arch-aarch64.Po ./$(DEPDIR)/arch-i386.Po \
6e5fae
 @AMDEP_TRUE@	./$(DEPDIR)/arch-ia64.Po ./$(DEPDIR)/arch-mips.Po \
6e5fae
 @AMDEP_TRUE@	./$(DEPDIR)/arch-ppc.Po ./$(DEPDIR)/arch-ppc64.Po \
6e5fae
 @AMDEP_TRUE@	./$(DEPDIR)/arch-s390.Po ./$(DEPDIR)/arch-s390x.Po \
6e5fae
@@ -277,6 +279,7 @@ distclean-compile:
6e5fae
 
6e5fae
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-alpha.Po@am__quote@
6e5fae
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-arm.Po@am__quote@
6e5fae
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-arch64.Po@am__quote@
6e5fae
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-i386.Po@am__quote@
6e5fae
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-ia64.Po@am__quote@
6e5fae
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips.Po@am__quote@
6e5fae
diff --git a/src/arch-aarch64.c b/src/arch-aarch64.c
6e5fae
new file mode 100644
6e5fae
index 0000000000..42eb2ececb
6e5fae
--- /dev/null
6e5fae
+++ b/src/arch-aarch64.c
6e5fae
@@ -0,0 +1,38 @@
6e5fae
+/* Copyright (C) 2015 Red Hat, Inc.
6e5fae
+   Written by Mark Salter <msalter@redhat.com>, 2015.
6e5fae
+
6e5fae
+   This program is free software; you can redistribute it and/or modify
6e5fae
+   it under the terms of the GNU General Public License as published by
6e5fae
+   the Free Software Foundation; either version 2, or (at your option)
6e5fae
+   any later version.
6e5fae
+
6e5fae
+   This program is distributed in the hope that it will be useful,
6e5fae
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
6e5fae
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6e5fae
+   GNU General Public License for more details.
6e5fae
+
6e5fae
+   You should have received a copy of the GNU General Public License
6e5fae
+   along with this program; if not, write to the Free Software Foundation,
6e5fae
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
6e5fae
+
6e5fae
+#include <config.h>
6e5fae
+#include <assert.h>
6e5fae
+#include <errno.h>
6e5fae
+#include <fcntl.h>
6e5fae
+#include <stdio.h>
6e5fae
+#include <string.h>
6e5fae
+#include <locale.h>
6e5fae
+#include <error.h>
6e5fae
+#include <argp.h>
6e5fae
+#include <stdlib.h>
6e5fae
+
6e5fae
+#include "prelink.h"
6e5fae
+
6e5fae
+PL_ARCH = {
6e5fae
+  .name = "AArch64",
6e5fae
+  .class = ELFCLASS64,
6e5fae
+  .machine = EM_AARCH64,
6e5fae
+  .alternate_machine = { EM_NONE },
6e5fae
+  .max_page_size = 0x10000,
6e5fae
+  .page_size = 0x1000
6e5fae
+};
6e5fae
-- 
6e5fae
2.1.0
6e5fae