diff -ruN prelink-0.4.4-1.el6.src.rpm-rpmbuild/SOURCES/prelink-arm1.patch prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SOURCES/prelink-arm1.patch
--- prelink-0.4.4-1.el6.src.rpm-rpmbuild/SOURCES/prelink-arm1.patch	1970-01-01 01:00:00.000000000 +0100
+++ prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SOURCES/prelink-arm1.patch	2011-09-13 11:07:15.000000000 +0100
@@ -0,0 +1,54 @@
+Index: ChangeLog
+===================================================================
+--- ChangeLog	(revision 190)
++++ ChangeLog	(revision 191)
+@@ -1,3 +1,10 @@
++2011-08-25  William Cohen  <wcohen@redhat.com>
++
++	* testsuite/shuffle2.c: Use %nobits instead of @nobits
++	to be arm assembler friendly.
++	* testsuite/shuffle9.c: Likewise.
++	* testsuite/reloc5.c (main): Likewise.
++
+ 2010-11-23  Jakub Jelinek  <jakub@redhat.com>
+ 
+ 	* src/dwarf2.h (DW_OP_GNU_implicit_pointer): Define.
+Index: testsuite/shuffle9.c
+===================================================================
+--- testsuite/shuffle9.c	(revision 190)
++++ testsuite/shuffle9.c	(revision 191)
+@@ -16,7 +16,7 @@
+   exit (0);
+ }
+ 
+-asm (".section nonalloced,\"aw\",@nobits\n\t"
++asm (".section nonalloced,\"aw\",%nobits\n\t"
+      ".globl testzero\n\t"
+      "testzero: .skip 16384\n\t"
+      ".previous\n");
+Index: testsuite/shuffle2.c
+===================================================================
+--- testsuite/shuffle2.c	(revision 190)
++++ testsuite/shuffle2.c	(revision 191)
+@@ -16,7 +16,7 @@
+   exit (0);
+ }
+ 
+-asm (".section nonalloced,\"aw\",@nobits\n\t"
++asm (".section nonalloced,\"aw\",%nobits\n\t"
+      ".globl testzero\n\t"
+      "testzero: .skip 16384\n\t"
+      ".previous");
+Index: testsuite/reloc5.c
+===================================================================
+--- testsuite/reloc5.c	(revision 190)
++++ testsuite/reloc5.c	(revision 191)
+@@ -14,7 +14,7 @@
+   printf ("  for (x = 0; x < 16384; ++x)\n");
+   printf ("    if (testzero[x]) abort ();\n");
+   printf ("  exit (0);\n}\n\n");
+-  printf ("asm (\".section nonalloced,\\\"aw\\\",@nobits\\n\\t\"\n");
++  printf ("asm (\".section nonalloced,\\\"aw\\\",%%nobits\\n\\t\"\n");
+   printf ("     \".globl testzero\\n\\t\"\n");
+   printf ("     \"testzero: .skip 16384\\n\\t\"\n");
+   printf ("     \".previous\");\n");
diff -ruN prelink-0.4.4-1.el6.src.rpm-rpmbuild/SOURCES/prelink-arm2.patch prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SOURCES/prelink-arm2.patch
--- prelink-0.4.4-1.el6.src.rpm-rpmbuild/SOURCES/prelink-arm2.patch	1970-01-01 01:00:00.000000000 +0100
+++ prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SOURCES/prelink-arm2.patch	2011-09-13 11:01:03.000000000 +0100
@@ -0,0 +1,197 @@
+Index: ChangeLog
+===================================================================
+--- ChangeLog	(revision 191)
++++ ChangeLog	(revision 192)
+@@ -1,3 +1,16 @@
++2011-08-25  Jakub Jelinek  <jakub@redhat.com>
++
++	* testsuite/cxx1.sh: Don't check for any "Removing C++ conflict"
++	messages on arm.
++	* testsuite/cxx2.sh: Likewise.
++	* testsuite/cxx3.sh: New test.
++	* testsuite/cxx3.C: New file.
++	* testsuite/cxx3.h: New file.
++	* testsuite/cxx3lib1.C: New file.
++	* testsuite/cxx3lib2.C: New file.
++	* testsuite/Makefile.am (TESTS): Add cxx3.sh.
++	* testsuite/Makefile.in: Regenerated.
++
+ 2011-08-25  William Cohen  <wcohen@redhat.com>
+ 
+ 	* testsuite/shuffle2.c: Use %nobits instead of @nobits
+Index: testsuite/cxx3lib2.C
+===================================================================
+--- testsuite/cxx3lib2.C	(revision 0)
++++ testsuite/cxx3lib2.C	(revision 192)
+@@ -0,0 +1,5 @@
++#include "cxx3.h"
++
++A a2;
++B b2;
++C c;
+Index: testsuite/Makefile.in
+===================================================================
+--- testsuite/Makefile.in	(revision 191)
++++ testsuite/Makefile.in	(revision 192)
+@@ -107,7 +107,8 @@
+ 	shuffle6.sh shuffle7.sh shuffle8.sh shuffle9.sh undo1.sh \
+ 	layout1.sh layout2.sh \
+ 	tls1.sh tls2.sh tls3.sh tls4.sh tls5.sh tls6.sh tls7.sh \
+-	cxx1.sh cxx2.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \
++	cxx1.sh cxx2.sh cxx3.sh quick1.sh quick2.sh quick3.sh \
++	cycle1.sh cycle2.sh \
+ 	deps1.sh deps2.sh \
+ 	ifunc1.sh ifunc2.sh ifunc3.sh \
+ 	undosyslibs.sh
+Index: testsuite/cxx1.sh
+===================================================================
+--- testsuite/cxx1.sh	(revision 191)
++++ testsuite/cxx1.sh	(revision 192)
+@@ -11,7 +11,10 @@
+ echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx1 > cxx1.log
+ $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx1 >> cxx1.log 2>&1 || exit 1
+ grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep -q -v 'C++ conflict' && exit 2
+-[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep 'Removing C++ conflict' | wc -l ) -ge 5 ] || exit 3
++case "`uname -m`" in
++  arm*) ;; # EABI says that vtables/typeinfo aren't vague linkage if there is a key method
++  *) [ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx1.log | grep 'Removing C++ conflict' | wc -l ) -ge 5 ] || exit 3;;
++esac
+ LD_LIBRARY_PATH=. ./cxx1 || exit 4
+ readelf -a ./cxx1 >> cxx1.log 2>&1 || exit 5
+ # So that it is not prelinked again
+Index: testsuite/cxx3lib1.C
+===================================================================
+--- testsuite/cxx3lib1.C	(revision 0)
++++ testsuite/cxx3lib1.C	(revision 192)
+@@ -0,0 +1,13 @@
++#include "cxx3.h"
++
++A a1;
++B b1;
++C c1;
++
++void
++do_check (void (*check) (A *x, B *y), A *x)
++{
++  B y;
++
++  check (x, &y);
++}
+Index: testsuite/cxx3.sh
+===================================================================
+--- testsuite/cxx3.sh	(revision 0)
++++ testsuite/cxx3.sh	(revision 192)
+@@ -0,0 +1,19 @@
++#!/bin/bash
++. `dirname $0`/functions.sh
++rm -f cxx3 cxx3lib*.so cxx3.log
++rm -f prelink.cache
++$CXX -shared -O2 -fpic -o cxx3lib1.so $srcdir/cxx3lib1.C
++$CXX -shared -O2 -fpic -o cxx3lib2.so $srcdir/cxx3lib2.C cxx3lib1.so
++BINS="cxx3"
++LIBS="cxx3lib1.so cxx3lib2.so"
++$CXXLINK -o cxx3 $srcdir/cxx3.C -Wl,--rpath-link,. cxx3lib2.so
++savelibs
++echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx3 > cxx3.log
++$PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx3 >> cxx3.log 2>&1 || exit 1
++grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx3.log | grep -q -v 'C++ conflict' && exit 2
++[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx3.log | grep 'Removing C++ conflict' | wc -l ) -ge 34 ] || exit 3
++LD_LIBRARY_PATH=. ./cxx3 || exit 4
++readelf -a ./cxx3 >> cxx3.log 2>&1 || exit 5
++# So that it is not prelinked again
++chmod -x ./cxx3
++comparelibs >> cxx3.log 2>&1 || exit 6
+
+Property changes on: testsuite/cxx3.sh
+___________________________________________________________________
+Added: svn:executable
+   + *
+
+Index: testsuite/cxx3.C
+===================================================================
+--- testsuite/cxx3.C	(revision 0)
++++ testsuite/cxx3.C	(revision 192)
+@@ -0,0 +1,26 @@
++#include "cxx3.h"
++extern "C" void abort (void);
++
++void
++check (A *x, B *y)
++{
++  C d;
++  if (x->b () != 2)
++    abort ();
++  if (y->B::a () != 3)
++    abort ();
++  if (d.a () != 4)
++    abort ();
++  if (d.C::b () != 5)
++    abort ();
++}
++
++int
++main ()
++{
++  A x;
++  if (x.a () != 1)
++    abort ();
++  do_check (check, &x);
++  return 0;
++}
+Index: testsuite/cxx2.sh
+===================================================================
+--- testsuite/cxx2.sh	(revision 191)
++++ testsuite/cxx2.sh	(revision 192)
+@@ -11,7 +11,10 @@
+ echo $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx2 > cxx2.log
+ $PRELINK -vvvv ${PRELINK_OPTS--vm} ./cxx2 >> cxx2.log 2>&1 || exit 1
+ grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep -q -v 'C++ conflict' && exit 2
+-[ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep 'Removing C++ conflict' | wc -l ) -ge 9 ] || exit 3
++case "`uname -m`" in
++  arm*) ;; # EABI says that vtables/typeinfo aren't vague linkage if there is a key method
++  *) [ $( grep ^`echo $PRELINK | sed 's/ .*$/: /'` cxx2.log | grep 'Removing C++ conflict' | wc -l ) -ge 9 ] || exit 3;;
++esac
+ LD_LIBRARY_PATH=. ./cxx2 || exit 4
+ readelf -a ./cxx2 >> cxx2.log 2>&1 || exit 5
+ # So that it is not prelinked again
+Index: testsuite/Makefile.am
+===================================================================
+--- testsuite/Makefile.am	(revision 191)
++++ testsuite/Makefile.am	(revision 192)
+@@ -12,7 +12,8 @@
+ 	shuffle6.sh shuffle7.sh shuffle8.sh shuffle9.sh undo1.sh \
+ 	layout1.sh layout2.sh \
+ 	tls1.sh tls2.sh tls3.sh tls4.sh tls5.sh tls6.sh tls7.sh \
+-	cxx1.sh cxx2.sh quick1.sh quick2.sh quick3.sh cycle1.sh cycle2.sh \
++	cxx1.sh cxx2.sh cxx3.sh quick1.sh quick2.sh quick3.sh \
++	cycle1.sh cycle2.sh \
+ 	deps1.sh deps2.sh \
+ 	ifunc1.sh ifunc2.sh ifunc3.sh \
+ 	undosyslibs.sh
+Index: testsuite/cxx3.h
+===================================================================
+--- testsuite/cxx3.h	(revision 0)
++++ testsuite/cxx3.h	(revision 192)
+@@ -0,0 +1,22 @@
++struct A
++  {
++    virtual int a () { return 1; }
++    virtual int b () { return 2; }
++    virtual ~A () {}
++    int c;
++  };
++struct B
++  {
++    virtual int a () { return 3; }
++    virtual ~B () {}
++    int b;
++  };
++struct C
++  {
++    virtual int a () { return 4; }
++    virtual int b () { return 5; }
++    virtual ~C () {}
++    int c;
++  };
++
++void do_check (void (*check) (A *x, B *y), A *x);
diff -ruN prelink-0.4.4-1.el6.src.rpm-rpmbuild/SOURCES/prelink-arm3.patch prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SOURCES/prelink-arm3.patch
--- prelink-0.4.4-1.el6.src.rpm-rpmbuild/SOURCES/prelink-arm3.patch	1970-01-01 01:00:00.000000000 +0100
+++ prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SOURCES/prelink-arm3.patch	2011-09-13 11:01:03.000000000 +0100
@@ -0,0 +1,173 @@
+Index: src/gather.c
+===================================================================
+--- src/gather.c	(revision 192)
++++ src/gather.c	(revision 193)
+@@ -736,25 +736,36 @@
+ 		  if (e_ident [offsetof (Elf32_Ehdr, e_phoff)]
+ 		      == sizeof (Elf32_Ehdr)
+ 		      && memcmp (e_ident + offsetof (Elf32_Ehdr, e_phoff) + 1,
+-				 "\0\0\0", 3) == 0
+-		      && (e_ident [offsetof (Elf32_Ehdr, e_phnum)]
+-			  || e_ident [offsetof (Elf32_Ehdr, e_phnum) + 1])
+-		      && e_ident [sizeof (Elf32_Ehdr)
+-				  + offsetof (Elf32_Phdr, p_type)] == PT_PHDR
+-		      && memcmp (e_ident + sizeof (Elf32_Ehdr)
+-				 + offsetof (Elf32_Phdr, p_type) + 1,
+ 				 "\0\0\0", 3) == 0)
+ 		    {
++		      Elf32_Half phnum, i;
++		      unsigned char *p;
++		      phnum = e_ident [offsetof (Elf32_Ehdr, e_phnum)]
++			      + (e_ident [offsetof (Elf32_Ehdr, e_phnum) + 1]
++				 << 8);
++		      p = e_ident + sizeof (Elf32_Ehdr)
++			  + offsetof (Elf32_Phdr, p_type);
++		      for (i = 0; i < phnum; i++, p += sizeof (Elf32_Phdr))
++			{
++			  if (p[0] == PT_PHDR
++			      && memcmp (p + 1, "\0\0\0", 3) == 0)
++			    {
+ maybe_pie:
+-		      dso = fdopen_dso (fd, name);
+-		      if (dso == NULL)
+-			goto close_it;
+-		      if (dynamic_info_is_set (dso, DT_DEBUG))
+-			{
+-			  close_dso (dso);
+-			  goto make_unprelinkable;
++			      dso = fdopen_dso (fd, name);
++			      if (dso == NULL)
++				goto close_it;
++			      if (dynamic_info_is_set (dso, DT_DEBUG))
++				{
++				  close_dso (dso);
++				  goto make_unprelinkable;
++				}
++			      close_dso (dso);
++			      goto close_it;
++			    }
++			  if (p[3] < (PT_LOPROC >> 24)
++			      || p[3] > (PT_HIPROC >> 24))
++			    break;
+ 			}
+-		      close_dso (dso);
+ 		    }
+ 		  goto close_it;
+ 		}
+@@ -763,15 +774,25 @@
+ 		  if (e_ident [offsetof (Elf64_Ehdr, e_phoff)]
+ 		      == sizeof (Elf64_Ehdr)
+ 		      && memcmp (e_ident + offsetof (Elf64_Ehdr, e_phoff) + 1,
+-				 "\0\0\0\0\0\0\0", 7) == 0
+-		      && (e_ident [offsetof (Elf64_Ehdr, e_phnum)]
+-			  || e_ident [offsetof (Elf64_Ehdr, e_phnum) + 1])
+-		      && e_ident [sizeof (Elf64_Ehdr)
+-				  + offsetof (Elf64_Phdr, p_type)] == PT_PHDR
+-		      && memcmp (e_ident + sizeof (Elf64_Ehdr)
+-				 + offsetof (Elf64_Phdr, p_type) + 1,
+-				 "\0\0\0", 3) == 0)
+-		    goto maybe_pie;
++				 "\0\0\0\0\0\0\0", 7) == 0)
++		    {
++		      Elf64_Half phnum, i;
++		      unsigned char *p;
++		      phnum = e_ident [offsetof (Elf64_Ehdr, e_phnum)]
++			      + (e_ident [offsetof (Elf64_Ehdr, e_phnum) + 1]
++				 << 8);
++		      p = e_ident + sizeof (Elf64_Ehdr)
++			  + offsetof (Elf64_Phdr, p_type);
++		      for (i = 0; i < phnum; i++, p += sizeof (Elf64_Phdr))
++			{
++			  if (p[0] == PT_PHDR
++			      && memcmp (p + 1, "\0\0\0", 3) == 0)
++			    goto maybe_pie;
++			  if (p[3] < (PT_LOPROC >> 24)
++			      || p[3] > (PT_HIPROC >> 24))
++			    break;
++			}
++		    }
+ 		  goto close_it;
+ 		}
+ 	      else
+@@ -790,16 +811,24 @@
+ 		  if (e_ident [offsetof (Elf32_Ehdr, e_phoff) + 3]
+ 		      == sizeof (Elf32_Ehdr)
+ 		      && memcmp (e_ident + offsetof (Elf32_Ehdr, e_phoff),
+-				 "\0\0\0", 3) == 0
+-		      && (e_ident [offsetof (Elf32_Ehdr, e_phnum)]
+-			  || e_ident [offsetof (Elf32_Ehdr, e_phnum) + 1])
+-		      && e_ident [sizeof (Elf32_Ehdr)
+-				  + offsetof (Elf32_Phdr, p_type) + 3]
+-			 == PT_PHDR
+-		      && memcmp (e_ident + sizeof (Elf32_Ehdr)
+-				 + offsetof (Elf32_Phdr, p_type),
+ 				 "\0\0\0", 3) == 0)
+-		    goto maybe_pie;
++		    {
++		      Elf32_Half phnum, i;
++		      unsigned char *p;
++		      phnum = (e_ident [offsetof (Elf32_Ehdr, e_phnum)] << 8)
++			      + e_ident [offsetof (Elf32_Ehdr, e_phnum) + 1];
++		      p = e_ident + sizeof (Elf32_Ehdr)
++			  + offsetof (Elf32_Phdr, p_type);
++		      for (i = 0; i < phnum; i++, p += sizeof (Elf32_Phdr))
++			{
++			  if (p[3] == PT_PHDR
++			      && memcmp (p, "\0\0\0", 3) == 0)
++			    goto maybe_pie;
++			  if (p[0] < (PT_LOPROC >> 24)
++			      || p[0] > (PT_HIPROC >> 24))
++			    break;
++			}
++		    }
+ 		  goto close_it;
+ 		}
+ 	      else if (e_ident [EI_CLASS] == ELFCLASS64)
+@@ -807,16 +836,24 @@
+ 		  if (e_ident [offsetof (Elf64_Ehdr, e_phoff) + 7]
+ 		      == sizeof (Elf64_Ehdr)
+ 		      && memcmp (e_ident + offsetof (Elf64_Ehdr, e_phoff),
+-				 "\0\0\0\0\0\0\0", 7) == 0
+-		      && (e_ident [offsetof (Elf64_Ehdr, e_phnum)]
+-			  || e_ident [offsetof (Elf64_Ehdr, e_phnum) + 1])
+-		      && e_ident [sizeof (Elf64_Ehdr)
+-				  + offsetof (Elf64_Phdr, p_type) + 3]
+-			 == PT_PHDR
+-		      && memcmp (e_ident + sizeof (Elf64_Ehdr)
+-				 + offsetof (Elf64_Phdr, p_type),
+-				 "\0\0\0", 3) == 0)
+-		    goto maybe_pie;
++				 "\0\0\0\0\0\0\0", 7) == 0)
++		    {
++		      Elf64_Half phnum, i;
++		      unsigned char *p;
++		      phnum = (e_ident [offsetof (Elf64_Ehdr, e_phnum)] << 8)
++			      + e_ident [offsetof (Elf64_Ehdr, e_phnum) + 1];
++		      p = e_ident + sizeof (Elf64_Ehdr)
++			  + offsetof (Elf64_Phdr, p_type);
++		      for (i = 0; i < phnum; i++, p += sizeof (Elf64_Phdr))
++			{
++			  if (p[3] == PT_PHDR
++			      && memcmp (p, "\0\0\0", 3) == 0)
++			    goto maybe_pie;
++			  if (p[0] < (PT_LOPROC >> 24)
++			      || p[0] > (PT_HIPROC >> 24))
++			    break;
++			}
++		    }
+ 		  goto close_it;
+ 		}
+ 	      else
+Index: ChangeLog
+===================================================================
+--- ChangeLog	(revision 192)
++++ ChangeLog	(revision 193)
+@@ -1,5 +1,8 @@
+ 2011-08-25  Jakub Jelinek  <jakub@redhat.com>
+ 
++	* src/gather.c (gather_func): When looking for PT_PHDR header,
++	skip any PT_LOPROC ... PR_HIPROC phdrs.
++
+ 	* testsuite/cxx1.sh: Don't check for any "Removing C++ conflict"
+ 	messages on arm.
+ 	* testsuite/cxx2.sh: Likewise.
diff -ruN prelink-0.4.4-1.el6.src.rpm-rpmbuild/SPECS/prelink.spec prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SPECS/prelink.spec
--- prelink-0.4.4-1.el6.src.rpm-rpmbuild/SPECS/prelink.spec	2010-12-10 11:57:32.000000000 +0000
+++ prelink-0.4.4-1.el6.0.src.rpm-rpmbuild/SPECS/prelink.spec	2011-09-13 11:13:50.000000000 +0100
@@ -1,7 +1,7 @@
 Summary: An ELF prelinking utility
 Name: prelink
 Version: 0.4.4
-Release: 1%{?dist}
+Release: 1%{?dist}.0
 License: GPLv2+
 Group: System Environment/Base
 %define date 20101123
@@ -9,6 +9,9 @@
 Source2: prelink.conf
 Source3: prelink.cron
 Source4: prelink.sysconfig
+Patch1: prelink-arm1.patch
+Patch2: prelink-arm2.patch
+Patch3: prelink-arm3.patch
 Buildroot: %{_tmppath}/prelink-root
 #BuildRequires: libelf-devel >= 0.7.0-5
 BuildRequires: elfutils-libelf-devel-static
@@ -17,7 +20,7 @@
 Requires: glibc >= 2.2.4-18, coreutils, findutils
 Requires: util-linux, gawk, grep
 # For now
-ExclusiveArch: %{ix86} alpha sparc sparcv9 sparc64 s390 s390x x86_64 ppc ppc64
+ExclusiveArch: %{ix86} alpha sparc sparcv9 sparc64 s390 s390x x86_64 ppc ppc64 %{arm}
 
 %description
 The prelink package contains a utility which modifies ELF shared libraries
@@ -26,6 +29,9 @@
 
 %prep
 %setup -q -n prelink
+%patch1 
+%patch2 
+%patch3 
 
 %build
 sed -i -e '/^prelink_LDADD/s/$/ -lpthread/' src/Makefile.{am,in}
@@ -100,6 +106,9 @@
 %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/log/prelink/prelink.log
 
 %changelog
+* Tue Sep 13 2011 Gordan Bobic <gordan@bobich.net> 0.4.4-1.0
+- Fix building issues on ARM (#733089)
+
 * Tue Nov 23 2010 Jakub Jelinek <jakub@redhat.com> 0.4.4-1
 - support copying over extended attributes (#456105)
 - handle DW_OP_GNU_implicit_pointer, fix handling of DW_OP_call_ref
