diff options
author | Michael Lauer <mickey@vanille-media.de> | 2006-04-11 10:37:45 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-04-11 10:37:45 +0000 |
commit | 4dbac5bc4465261136bca6e3b9b2c35ddab50174 (patch) | |
tree | a76bd07fe80dff6f967c3ff5955bd936503cb09d /packages/prelink | |
parent | fab0d798c878034880b1a072684d1a0526ef7090 (diff) | |
parent | 02a7ba97f61e2d7ec73013612472307f0d9a8b34 (diff) |
merge of 830a2ca2c9484467078002caaef98f80db84c191
and a5073c2c09ef06e7875d4a30ddfdb0a9b8bd58f3
Diffstat (limited to 'packages/prelink')
21 files changed, 394 insertions, 345 deletions
diff --git a/packages/prelink/prelink-20031029/Makefile.in.patch b/packages/prelink/prelink-20031029/Makefile.in.patch deleted file mode 100644 index 930ea5f9c4..0000000000 --- a/packages/prelink/prelink-20031029/Makefile.in.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- prelink-0.0.20030902.orig/src/Makefile.in 2003-07-01 14:38:41.000000000 +0000 -+++ prelink-0.0.20030902/src/Makefile.in 2003-09-16 23:26:16.000000000 +0000 -@@ -108,7 +108,7 @@ - $(prelink_SYSDEPS) - - prelink_LDADD = @LIBGELF@ --prelink_LDFLAGS = -all-static -+#prelink_LDFLAGS = -all-static - - extra_DIST = makecrc.c - subdir = src diff --git a/packages/prelink/prelink-20031029/dso.c.patch b/packages/prelink/prelink-20031029/dso.c.patch deleted file mode 100644 index 1be2f52961..0000000000 --- a/packages/prelink/prelink-20031029/dso.c.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- prelink-0.0.20030902.orig/src/dso.c 2003-08-11 11:55:11.000000000 +0000 -+++ prelink-0.0.20030902/src/dso.c 2003-09-16 23:26:16.000000000 +0000 -@@ -334,7 +334,13 @@ - } - else - sections[--k] = i; -+/* this fails for the statically linked upx executable - assert (j == k); -+*/ -+ if (j != k) { -+ printf("assert(j == k) at dso.c:311 has failed for file %s\n", name); -+ goto error_out; -+ } - - section_cmp_dso = dso; - qsort (sections + k, dso->ehdr.e_shnum - k, sizeof (*sections), section_cmp); diff --git a/packages/prelink/prelink-20031029/layout.c.patch b/packages/prelink/prelink-20031029/layout.c.patch deleted file mode 100644 index 3961d84d0b..0000000000 --- a/packages/prelink/prelink-20031029/layout.c.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- prelink-0.0.20030902.orig/src/layout.c 2003-06-13 15:12:26.000000000 +0000 -+++ prelink-0.0.20030902/src/layout.c 2003-09-16 23:26:16.000000000 +0000 -@@ -614,7 +614,23 @@ - < ((deps[j - 1]->end + max_page_size - 1) - & ~(max_page_size - 1)) - && (deps[j]->type == ET_DYN || deps[j - 1]->type == ET_DYN)) -+{ /* XXX some binaries cause a segfault but I do not know why -- Md*/ -+ fprintf(stderr, -+ "Unknown fatal error at src/layout.c:538\n" -+ "l.binlibs[i]->filename: %s\n" -+ "deps[j]->base: %lx\n" -+ "(deps[j - 1]->end + max_page_size - 1) & ~(max_page_size - 1): %ld\n" -+ "[deps[j - 1]->end: %lx max_page_size: %lu]\n" -+ "deps[j]->type: %x deps[j - 1]->type: %x\n" -+ , -+ l.binlibs[i]->filename, -+ deps[j]->base, -+ ((deps[j - 1]->end + max_page_size - 1) & ~(max_page_size - 1)), -+ deps[j - 1]->end, max_page_size, -+ deps[j]->type, deps[j - 1]->type -+ ); - abort (); -+} - } - #endif - } diff --git a/packages/prelink/prelink-20031029/prelink.conf b/packages/prelink/prelink-20031029/prelink.conf deleted file mode 100644 index 1777aa849e..0000000000 --- a/packages/prelink/prelink-20031029/prelink.conf +++ /dev/null @@ -1,21 +0,0 @@ ---- prelink-0.0.20040115.orig/debian/prelink.conf -+++ prelink-0.0.20040115/debian/prelink.conf -@@ -0,0 +1,18 @@ -+# This config file contains a list of directories both with binaries -+# and libraries prelink should consider by default. -+# If a directory name is prefixed with `-l ', the directory hierarchy -+# will be walked as long as filesystem boundaries are not crossed. -+# If a directory name is prefixed with `-h ', symbolic links in a -+# directory hierarchy are followed. -+-l /usr/local/sbin -+-l /sbin -+-l /usr/sbin -+-l /usr/local/bin -+-l /bin -+-l /usr/bin -+-l /usr/X11R6/bin -+-l /usr/games -+-l /usr/local/lib -+-l /lib -+-l /usr/lib -+-l /usr/X11R6/lib diff --git a/packages/prelink/prelink-20031029/prelink.cron.daily b/packages/prelink/prelink-20031029/prelink.cron.daily deleted file mode 100644 index 91983ee18b..0000000000 --- a/packages/prelink/prelink-20031029/prelink.cron.daily +++ /dev/null @@ -1,43 +0,0 @@ ---- prelink-0.0.20040115.orig/debian/prelink.cron.daily -+++ prelink-0.0.20040115/debian/prelink.cron.daily -@@ -0,0 +1,40 @@ -+#!/bin/sh -+ -+. /etc/default/prelink -+ -+renice +19 -p $$ >/dev/null 2>&1 -+ -+if [ "$PRELINKING" != yes ]; then -+ if [ -f /etc/prelink.cache ]; then -+ echo /usr/sbin/prelink -uav > /var/log/prelink.log -+ /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1 -+ rm -f /etc/prelink.cache -+ # Restart init if needed -+ [ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u -+ fi -+ exit 0 -+fi -+ -+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \ -+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then -+ # If cache does not exist or is from older prelink versions or -+ # if we were asked to explicitely, force full prelinking -+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force -+ PRELINK_OPTS="$PRELINK_OPTS -f" -+ date > /var/lib/misc/prelink.full -+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \ -+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \ -+ = /var/lib/misc/prelink.full ]; then -+ # If prelink without -q has been run in the last -+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode -+ PRELINK_OPTS="$PRELINK_OPTS -q" -+else -+ date > /var/lib/misc/prelink.full -+fi -+ -+echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log -+/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1 -+# Restart init if needed -+[ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u -+ -+exit 0 diff --git a/packages/prelink/prelink-20031029/prelink.default b/packages/prelink/prelink-20031029/prelink.default deleted file mode 100644 index d89649e49b..0000000000 --- a/packages/prelink/prelink-20031029/prelink.default +++ /dev/null @@ -1,25 +0,0 @@ ---- prelink-0.0.20040115.orig/debian/prelink.default -+++ prelink-0.0.20040115/debian/prelink.default -@@ -0,0 +1,22 @@ -+# Set this to no to disable prelinking altogether -+# or to yes to enable it. -+# (if you change this from yes to no prelink -ua -+# will be run next night to undo prelinking) -+PRELINKING=unknown -+ -+# Options to pass to prelink -+# -m Try to conserve virtual memory by allowing overlapping -+# assigned virtual memory slots for libraries which -+# never appear together in one binary -+# -R Randomize virtual memory slot assignments for libraries. -+# This makes it slightly harder for various buffer overflow -+# attacks, since library addresses will be different on each -+# host using -R. -+PRELINK_OPTS=-mR -+ -+# How often should full prelink be run (in days) -+# Normally, prelink will be run in quick mode, every -+# $PRELINK_FULL_TIME_INTERVAL days it will be run -+# in normal mode. Comment this line out if prelink -+# should be run in normal mode always. -+PRELINK_FULL_TIME_INTERVAL=14 diff --git a/packages/prelink/prelink-20031029/prelink.h.patch b/packages/prelink/prelink-20031029/prelink.h.patch deleted file mode 100644 index 3ca2930d3a..0000000000 --- a/packages/prelink/prelink-20031029/prelink.h.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- prelink-0.0.20030902.orig/src/prelink.h 2003-08-11 11:54:01.000000000 +0000 -+++ prelink-0.0.20030902/src/prelink.h 2003-09-16 23:26:16.000000000 +0000 -@@ -26,6 +26,45 @@ - #include <stdio.h> - #include <sys/stat.h> - -+/* http://gcc.gnu.org/ml/gcc/2003-01/msg00922.html */ -+#ifndef R_390_TLS_DTPMOD -+#define R_390_TLS_DTPMOD 54 -+#define R_390_TLS_DTPOFF 55 -+#define R_390_TLS_TPOFF 56 -+#endif -+ -+/* from http://www.cygwin.com/ml/libc-alpha/2003-02/msg00241.html */ -+#ifndef R_PPC_TLS -+#define R_PPC_TLS 67 -+#define R_PPC_DTPMOD32 68 -+#define R_PPC_TPREL16 69 -+#define R_PPC_TPREL16_LO 70 -+#define R_PPC_TPREL16_HI 71 -+#define R_PPC_TPREL16_HA 72 -+#define R_PPC_TPREL32 73 -+#define R_PPC_DTPREL16 74 -+#define R_PPC_DTPREL16_LO 75 -+#define R_PPC_DTPREL16_HI 76 -+#define R_PPC_DTPREL16_HA 77 -+#define R_PPC_DTPREL32 78 -+#define R_PPC_GOT_TLSGD16 79 -+#define R_PPC_GOT_TLSGD16_LO 80 -+#define R_PPC_GOT_TLSGD16_HI 81 -+#define R_PPC_GOT_TLSGD16_HA 82 -+#define R_PPC_GOT_TLSLD16 83 -+#define R_PPC_GOT_TLSLD16_LO 84 -+#define R_PPC_GOT_TLSLD16_HI 85 -+#define R_PPC_GOT_TLSLD16_HA 86 -+#define R_PPC_GOT_TPREL16 87 -+#define R_PPC_GOT_TPREL16_LO 88 -+#define R_PPC_GOT_TPREL16_HI 89 -+#define R_PPC_GOT_TPREL16_HA 90 -+#define R_PPC_GOT_DTPREL16 91 -+#define R_PPC_GOT_DTPREL16_LO 92 -+#define R_PPC_GOT_DTPREL16_HI 93 -+#define R_PPC_GOT_DTPREL16_HA 94 -+#endif -+ - #ifndef DT_GNU_LIBLIST - #define DT_GNU_LIBLIST 0x6ffffef9 - #define DT_GNU_LIBLISTSZ 0x6ffffdf7 diff --git a/packages/prelink/prelink-20031029/ts.Makefile.am.patch b/packages/prelink/prelink-20031029/ts.Makefile.am.patch deleted file mode 100644 index 6b8c3c5c38..0000000000 --- a/packages/prelink/prelink-20031029/ts.Makefile.am.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- prelink-0.0.20031029.orig/testsuite/Makefile.am 2003-09-02 21:44:23.000000000 +0000 -+++ prelink-0.0.20031029/testsuite/Makefile.am 2003-10-31 20:28:02.000000000 +0000 -@@ -11,7 +11,7 @@ - shuffle1.sh shuffle2.sh shuffle3.sh shuffle4.sh shuffle5.sh \ - shuffle6.sh shuffle7.sh \ - layout1.sh layout2.sh tls1.sh tls2.sh tls3.sh tls4.sh \ -- cxx1.sh quick1.sh cycle1.sh cycle2.sh \ -+ cxx1.sh cycle1.sh cycle2.sh \ - undosyslibs.sh - TESTS_ENVIRONMENT = \ - PRELINK="../src/prelink -c ./prelink.conf -C ./prelink.cache --ld-library-path=. --dynamic-linker=`echo ./ld*.so.*[0-9]`" \ diff --git a/packages/prelink/prelink-20031029/ts.Makefile.in.patch b/packages/prelink/prelink-20031029/ts.Makefile.in.patch deleted file mode 100644 index 4253badb65..0000000000 --- a/packages/prelink/prelink-20031029/ts.Makefile.in.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- prelink-0.0.20031029.orig/testsuite/Makefile.in 2003-10-28 20:01:56.000000000 +0000 -+++ prelink-0.0.20031029/testsuite/Makefile.in 2003-10-31 20:28:10.000000000 +0000 -@@ -106,7 +106,7 @@ - shuffle1.sh shuffle2.sh shuffle3.sh shuffle4.sh shuffle5.sh \ - shuffle6.sh shuffle7.sh \ - layout1.sh layout2.sh tls1.sh tls2.sh tls3.sh tls4.sh \ -- cxx1.sh quick1.sh cycle1.sh cycle2.sh \ -+ cxx1.sh cycle1.sh cycle2.sh \ - undosyslibs.sh - - TESTS_ENVIRONMENT = \ diff --git a/packages/prelink/prelink-20040304/.mtn2git_empty b/packages/prelink/prelink-20040304/.mtn2git_empty deleted file mode 100644 index e69de29bb2..0000000000 --- a/packages/prelink/prelink-20040304/.mtn2git_empty +++ /dev/null diff --git a/packages/prelink/prelink-20040304/prelink.conf b/packages/prelink/prelink-20040304/prelink.conf deleted file mode 100644 index 1777aa849e..0000000000 --- a/packages/prelink/prelink-20040304/prelink.conf +++ /dev/null @@ -1,21 +0,0 @@ ---- prelink-0.0.20040115.orig/debian/prelink.conf -+++ prelink-0.0.20040115/debian/prelink.conf -@@ -0,0 +1,18 @@ -+# This config file contains a list of directories both with binaries -+# and libraries prelink should consider by default. -+# If a directory name is prefixed with `-l ', the directory hierarchy -+# will be walked as long as filesystem boundaries are not crossed. -+# If a directory name is prefixed with `-h ', symbolic links in a -+# directory hierarchy are followed. -+-l /usr/local/sbin -+-l /sbin -+-l /usr/sbin -+-l /usr/local/bin -+-l /bin -+-l /usr/bin -+-l /usr/X11R6/bin -+-l /usr/games -+-l /usr/local/lib -+-l /lib -+-l /usr/lib -+-l /usr/X11R6/lib diff --git a/packages/prelink/prelink-20040304/prelink.cron.daily b/packages/prelink/prelink-20040304/prelink.cron.daily deleted file mode 100644 index 91983ee18b..0000000000 --- a/packages/prelink/prelink-20040304/prelink.cron.daily +++ /dev/null @@ -1,43 +0,0 @@ ---- prelink-0.0.20040115.orig/debian/prelink.cron.daily -+++ prelink-0.0.20040115/debian/prelink.cron.daily -@@ -0,0 +1,40 @@ -+#!/bin/sh -+ -+. /etc/default/prelink -+ -+renice +19 -p $$ >/dev/null 2>&1 -+ -+if [ "$PRELINKING" != yes ]; then -+ if [ -f /etc/prelink.cache ]; then -+ echo /usr/sbin/prelink -uav > /var/log/prelink.log -+ /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1 -+ rm -f /etc/prelink.cache -+ # Restart init if needed -+ [ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u -+ fi -+ exit 0 -+fi -+ -+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \ -+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then -+ # If cache does not exist or is from older prelink versions or -+ # if we were asked to explicitely, force full prelinking -+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force -+ PRELINK_OPTS="$PRELINK_OPTS -f" -+ date > /var/lib/misc/prelink.full -+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \ -+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \ -+ = /var/lib/misc/prelink.full ]; then -+ # If prelink without -q has been run in the last -+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode -+ PRELINK_OPTS="$PRELINK_OPTS -q" -+else -+ date > /var/lib/misc/prelink.full -+fi -+ -+echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log -+/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1 -+# Restart init if needed -+[ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u -+ -+exit 0 diff --git a/packages/prelink/prelink-20040304/prelink.default b/packages/prelink/prelink-20040304/prelink.default deleted file mode 100644 index d89649e49b..0000000000 --- a/packages/prelink/prelink-20040304/prelink.default +++ /dev/null @@ -1,25 +0,0 @@ ---- prelink-0.0.20040115.orig/debian/prelink.default -+++ prelink-0.0.20040115/debian/prelink.default -@@ -0,0 +1,22 @@ -+# Set this to no to disable prelinking altogether -+# or to yes to enable it. -+# (if you change this from yes to no prelink -ua -+# will be run next night to undo prelinking) -+PRELINKING=unknown -+ -+# Options to pass to prelink -+# -m Try to conserve virtual memory by allowing overlapping -+# assigned virtual memory slots for libraries which -+# never appear together in one binary -+# -R Randomize virtual memory slot assignments for libraries. -+# This makes it slightly harder for various buffer overflow -+# attacks, since library addresses will be different on each -+# host using -R. -+PRELINK_OPTS=-mR -+ -+# How often should full prelink be run (in days) -+# Normally, prelink will be run in quick mode, every -+# $PRELINK_FULL_TIME_INTERVAL days it will be run -+# in normal mode. Comment this line out if prelink -+# should be run in normal mode always. -+PRELINK_FULL_TIME_INTERVAL=14 diff --git a/packages/prelink/prelink-20031029/.mtn2git_empty b/packages/prelink/prelink-20050901/.mtn2git_empty index e69de29bb2..e69de29bb2 100644 --- a/packages/prelink/prelink-20031029/.mtn2git_empty +++ b/packages/prelink/prelink-20050901/.mtn2git_empty diff --git a/packages/prelink/prelink-20050901/arm_eabi.patch b/packages/prelink/prelink-20050901/arm_eabi.patch new file mode 100644 index 0000000000..b234af9b3f --- /dev/null +++ b/packages/prelink/prelink-20050901/arm_eabi.patch @@ -0,0 +1,286 @@ +Index: prelink-0.0.20050901/src/arch-arm.c +=================================================================== +--- prelink-0.0.20050901.orig/src/arch-arm.c 2004-09-30 17:07:57.000000000 +0100 ++++ prelink-0.0.20050901/src/arch-arm.c 2006-04-07 14:41:25.000000000 +0100 +@@ -145,6 +145,24 @@ + error (0, 0, "%s: R_ARM_PC24 relocs with non-zero addend should not be present in prelinked REL sections", + dso->filename); + return 1; ++ case R_ARM_TLS_DTPOFF32: ++ write_le32 (dso, rel->r_offset, value); ++ break; ++ /* DTPMOD32 and TPOFF32 is impossible to predict unless prelink ++ sets the rules. Also for TPOFF{32,} there is REL->RELA problem. */ ++ case R_ARM_TLS_DTPMOD32: ++ if (dso->ehdr.e_type == ET_EXEC) ++ { ++ error (0, 0, "%s: R_ARM_TLS_DTPMOD32 reloc in executable?", ++ dso->filename); ++ return 1; ++ } ++ break; ++ case R_ARM_TLS_TPOFF32: ++ if (dso->ehdr.e_type == ET_EXEC) ++ error (0, 0, "%s: R_ARM_TLS_TPOFF32 relocs should not be present in prelinked ET_EXEC REL sections", ++ dso->filename); ++ break; + case R_ARM_COPY: + if (dso->ehdr.e_type == ET_EXEC) + /* COPY relocs are handled specially in generic code. */ +@@ -195,6 +213,24 @@ + write_le32 (dso, rela->r_offset, + (read_ule32 (dso, rela->r_offset) & 0xff000000) | val); + break; ++ case R_ARM_TLS_DTPOFF32: ++ write_le32 (dso, rela->r_offset, value + rela->r_addend); ++ break; ++ /* DTPMOD32 and TPOFF32 is impossible to predict unless prelink ++ sets the rules. */ ++ case R_ARM_TLS_DTPMOD32: ++ if (dso->ehdr.e_type == ET_EXEC) ++ { ++ error (0, 0, "%s: R_ARM_TLS_DTPMOD32 reloc in executable?", ++ dso->filename); ++ return 1; ++ } ++ break; ++ case R_ARM_TLS_TPOFF32: ++ if (dso->ehdr.e_type == ET_EXEC && info->resolvetls) ++ write_le32 (dso, rela->r_offset, ++ -(value + rela->r_addend - info->resolvetls->offset)); ++ break; + case R_ARM_COPY: + if (dso->ehdr.e_type == ET_EXEC) + /* COPY relocs are handled specially in generic code. */ +@@ -315,6 +351,7 @@ + { + GElf_Addr value; + struct prelink_conflict *conflict; ++ struct prelink_tls *tls; + GElf_Rela *ret; + + if (GELF_R_TYPE (rel->r_info) == R_ARM_RELATIVE +@@ -324,8 +361,31 @@ + conflict = prelink_conflict (info, GELF_R_SYM (rel->r_info), + GELF_R_TYPE (rel->r_info)); + if (conflict == NULL) +- return 0; +- value = conflict_lookup_value (conflict); ++ { ++ if (info->curtls == NULL) ++ return 0; ++ switch (GELF_R_TYPE (rel->r_info)) ++ { ++ /* Even local DTPMOD and TPOFF relocs need conflicts. */ ++ case R_ARM_TLS_DTPMOD32: ++ case R_ARM_TLS_TPOFF32: ++ break; ++ default: ++ return 0; ++ } ++ value = 0; ++ } ++ else ++ { ++ /* DTPOFF32 wants to see only real conflicts, not lookups ++ with reloc_class RTYPE_CLASS_TLS. */ ++ if (GELF_R_TYPE (rel->r_info) == R_ARM_TLS_DTPOFF32 ++ && conflict->lookup.tls == conflict->conflict.tls ++ && conflict->lookupval == conflict->conflictval) ++ return 0; ++ ++ value = conflict_lookup_value (conflict); ++ } + ret = prelink_conflict_add_rela (info); + if (ret == NULL) + return 1; +@@ -342,6 +402,33 @@ + error (0, 0, "%s: R_ARM_%s relocs should not be present in prelinked REL sections", + dso->filename, GELF_R_TYPE (rel->r_info) == R_ARM_ABS32 ? "ABS32" : "PC24"); + return 1; ++ case R_ARM_TLS_DTPMOD32: ++ case R_ARM_TLS_DTPOFF32: ++ case R_ARM_TLS_TPOFF32: ++ if (conflict != NULL ++ && (conflict->reloc_class != RTYPE_CLASS_TLS ++ || conflict->lookup.tls == NULL)) ++ { ++ error (0, 0, "%s: R_ARM_TLS not resolving to STT_TLS symbol", ++ dso->filename); ++ return 1; ++ } ++ tls = conflict ? conflict->lookup.tls : info->curtls; ++ ret->r_info = GELF_R_INFO (0, R_ARM_ABS32); ++ switch (GELF_R_TYPE (rel->r_info)) ++ { ++ case R_ARM_TLS_DTPMOD32: ++ ret->r_addend = tls->modid; ++ break; ++ case R_ARM_TLS_DTPOFF32: ++ ret->r_addend = value; ++ break; ++ case R_ARM_TLS_TPOFF32: ++ ret->r_addend = -(value + read_ule32 (dso, rel->r_offset) ++ - tls->offset); ++ break; ++ } ++ break; + case R_ARM_COPY: + error (0, 0, "R_ARM_COPY should not be present in shared libraries"); + return 1; +@@ -359,6 +446,7 @@ + { + GElf_Addr value; + struct prelink_conflict *conflict; ++ struct prelink_tls *tls; + GElf_Rela *ret; + Elf32_Sword val; + +@@ -369,8 +457,31 @@ + conflict = prelink_conflict (info, GELF_R_SYM (rela->r_info), + GELF_R_TYPE (rela->r_info)); + if (conflict == NULL) +- return 0; +- value = conflict_lookup_value (conflict); ++ { ++ if (info->curtls == NULL) ++ return 0; ++ switch (GELF_R_TYPE (rela->r_info)) ++ { ++ /* Even local DTPMOD and TPOFF relocs need conflicts. */ ++ case R_ARM_TLS_DTPMOD32: ++ case R_ARM_TLS_TPOFF32: ++ break; ++ default: ++ return 0; ++ } ++ value = 0; ++ } ++ else ++ { ++ /* DTPOFF32 wants to see only real conflicts, not lookups ++ with reloc_class RTYPE_CLASS_TLS. */ ++ if (GELF_R_TYPE (rela->r_info) == R_ARM_TLS_DTPOFF32 ++ && conflict->lookup.tls == conflict->conflict.tls ++ && conflict->lookupval == conflict->conflictval) ++ return 0; ++ ++ value = conflict_lookup_value (conflict); ++ } + ret = prelink_conflict_add_rela (info); + if (ret == NULL) + return 1; +@@ -398,6 +509,32 @@ + case R_ARM_COPY: + error (0, 0, "R_ARM_COPY should not be present in shared libraries"); + return 1; ++ case R_ARM_TLS_DTPMOD32: ++ case R_ARM_TLS_DTPOFF32: ++ case R_ARM_TLS_TPOFF32: ++ if (conflict != NULL ++ && (conflict->reloc_class != RTYPE_CLASS_TLS ++ || conflict->lookup.tls == NULL)) ++ { ++ error (0, 0, "%s: R_386_TLS not resolving to STT_TLS symbol", ++ dso->filename); ++ return 1; ++ } ++ tls = conflict ? conflict->lookup.tls : info->curtls; ++ ret->r_info = GELF_R_INFO (0, R_ARM_ABS32); ++ switch (GELF_R_TYPE (rela->r_info)) ++ { ++ case R_ARM_TLS_DTPMOD32: ++ ret->r_addend = tls->modid; ++ break; ++ case R_ARM_TLS_DTPOFF32: ++ ret->r_addend += value; ++ break; ++ case R_ARM_TLS_TPOFF32: ++ ret->r_addend = -(value + rela->r_addend - tls->offset); ++ break; ++ } ++ break; + default: + error (0, 0, "%s: Unknown arm relocation type %d", dso->filename, + (int) GELF_R_TYPE (rela->r_info)); +@@ -418,6 +555,7 @@ + abort (); + case R_ARM_RELATIVE: + case R_ARM_ABS32: ++ case R_ARM_TLS_TPOFF32: + rela->r_addend = (Elf32_Sword) read_ule32 (dso, rel->r_offset); + break; + case R_ARM_PC24: +@@ -426,6 +564,8 @@ + break; + case R_ARM_COPY: + case R_ARM_GLOB_DAT: ++ case R_ARM_TLS_DTPOFF32: ++ case R_ARM_TLS_DTPMOD32: + rela->r_addend = 0; + break; + } +@@ -445,6 +585,7 @@ + abort (); + case R_ARM_RELATIVE: + case R_ARM_ABS32: ++ case R_ARM_TLS_TPOFF32: + write_le32 (dso, rela->r_offset, rela->r_addend); + break; + case R_ARM_PC24: +@@ -453,6 +594,8 @@ + | ((rela->r_addend >> 2) & 0xffffff)); + break; + case R_ARM_GLOB_DAT: ++ case R_ARM_TLS_DTPMOD32: ++ case R_ARM_TLS_DTPOFF32: + write_le32 (dso, rela->r_offset, 0); + break; + } +@@ -488,6 +631,13 @@ + /* FALLTHROUGH */ + case R_ARM_PC24: + return 1; ++ case R_ARM_TLS_TPOFF32: ++ /* In shared libraries TPOFF is changed always into ++ conflicts, for executables we need to preserve ++ original addend. */ ++ if (dso->ehdr.e_type == ET_EXEC) ++ return 1; ++ break; + } + } + } +@@ -612,6 +762,12 @@ + return 0; + error (0, 0, "%s: R_ARM_COPY reloc in shared library?", dso->filename); + return 1; ++ case R_ARM_TLS_DTPMOD32: ++ case R_ARM_TLS_DTPOFF32: ++ write_le32 (dso, rel->r_offset, 0); ++ break; ++ case R_ARM_TLS_TPOFF32: ++ break; + default: + error (0, 0, "%s: Unknown arm relocation type %d", dso->filename, + (int) GELF_R_TYPE (rel->r_info)); +@@ -634,6 +790,10 @@ + { + case R_ARM_COPY: return RTYPE_CLASS_COPY; + case R_ARM_JUMP_SLOT: return RTYPE_CLASS_PLT; ++ case R_ARM_TLS_DTPMOD32: ++ case R_ARM_TLS_DTPOFF32: ++ case R_ARM_TLS_TPOFF32: ++ return RTYPE_CLASS_TLS; + default: return RTYPE_CLASS_VALID; + } + } +@@ -646,7 +806,7 @@ + .R_JMP_SLOT = R_ARM_JUMP_SLOT, + .R_COPY = R_ARM_COPY, + .R_RELATIVE = R_ARM_RELATIVE, +- .dynamic_linker = "/lib/ld-linux.so.2", ++ .dynamic_linker = "/lib/ld-linux.so.3", + .adjust_dyn = arm_adjust_dyn, + .adjust_rel = arm_adjust_rel, + .adjust_rela = arm_adjust_rela, diff --git a/packages/prelink/prelink-20050901/prelink.conf b/packages/prelink/prelink-20050901/prelink.conf new file mode 100644 index 0000000000..c5a4f4adc3 --- /dev/null +++ b/packages/prelink/prelink-20050901/prelink.conf @@ -0,0 +1,18 @@ +# This config file contains a list of directories both with binaries +# and libraries prelink should consider by default. +# If a directory name is prefixed with `-l ', the directory hierarchy +# will be walked as long as filesystem boundaries are not crossed. +# If a directory name is prefixed with `-h ', symbolic links in a +# directory hierarchy are followed. +-l /usr/local/sbin +-l /sbin +-l /usr/sbin +-l /usr/local/bin +-l /bin +-l /usr/bin +-l /usr/X11R6/bin +-l /usr/games +-l /usr/local/lib +-l /lib +-l /usr/lib +-l /usr/X11R6/lib diff --git a/packages/prelink/prelink-20050901/prelink.cron.daily b/packages/prelink/prelink-20050901/prelink.cron.daily new file mode 100644 index 0000000000..0b3c07322c --- /dev/null +++ b/packages/prelink/prelink-20050901/prelink.cron.daily @@ -0,0 +1,40 @@ +#!/bin/sh + +. /etc/default/prelink + +renice +19 -p $$ >/dev/null 2>&1 + +if [ "$PRELINKING" != yes ]; then + if [ -f /etc/prelink.cache ]; then + echo /usr/sbin/prelink -uav > /var/log/prelink.log + /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1 + rm -f /etc/prelink.cache + # Restart init if needed + [ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u + fi + exit 0 +fi + +if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \ + || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then + # If cache does not exist or is from older prelink versions or + # if we were asked to explicitely, force full prelinking + rm -f /etc/prelink.cache /var/lib/misc/prelink.force + PRELINK_OPTS="$PRELINK_OPTS -f" + date > /var/lib/misc/prelink.full +elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \ + -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \ + = /var/lib/misc/prelink.full ]; then + # If prelink without -q has been run in the last + # PRELINK_FULL_TIME_INTERVAL days, just use quick mode + PRELINK_OPTS="$PRELINK_OPTS -q" +else + date > /var/lib/misc/prelink.full +fi + +echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log +/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1 +# Restart init if needed +[ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u + +exit 0 diff --git a/packages/prelink/prelink-20050901/prelink.default b/packages/prelink/prelink-20050901/prelink.default new file mode 100644 index 0000000000..901258ed2a --- /dev/null +++ b/packages/prelink/prelink-20050901/prelink.default @@ -0,0 +1,22 @@ +# Set this to no to disable prelinking altogether +# or to yes to enable it. +# (if you change this from yes to no prelink -ua +# will be run next night to undo prelinking) +PRELINKING=unknown + +# Options to pass to prelink +# -m Try to conserve virtual memory by allowing overlapping +# assigned virtual memory slots for libraries which +# never appear together in one binary +# -R Randomize virtual memory slot assignments for libraries. +# This makes it slightly harder for various buffer overflow +# attacks, since library addresses will be different on each +# host using -R. +PRELINK_OPTS=-mR + +# How often should full prelink be run (in days) +# Normally, prelink will be run in quick mode, every +# $PRELINK_FULL_TIME_INTERVAL days it will be run +# in normal mode. Comment this line out if prelink +# should be run in normal mode always. +PRELINK_FULL_TIME_INTERVAL=14 diff --git a/packages/prelink/prelink_20031029.bb b/packages/prelink/prelink_20031029.bb deleted file mode 100644 index 1788dd3342..0000000000 --- a/packages/prelink/prelink_20031029.bb +++ /dev/null @@ -1,26 +0,0 @@ -SECTION = "devel" -DEPENDS = "elfutils " -DESCRIPTION = " The prelink package contains a utility which modifies ELF shared libraries \ -and executables, so that far fewer relocations need to be resolved at \ -runtime and thus programs come up faster." -LICENSE = "GPL" -SRC_URI = "ftp://people.redhat.com/jakub/prelink/prelink-${PV}.tar.bz2 \ - file://dso.c.patch;patch=1 \ - file://layout.c.patch;patch=1 \ - file://Makefile.in.patch;patch=1 \ - file://prelink.h.patch;patch=1 \ - file://ts.Makefile.am.patch;patch=1 \ - file://ts.Makefile.in.patch;patch=1 \ - file://prelink.conf \ - file://prelink.cron.daily \ - file://prelink.default" -S = "${WORKDIR}/prelink" - -inherit autotools - -do_install_append () { - install -d ${D}${sysconfdir}/cron.daily ${D}${sysconfdir}/default - install -m 0644 ${WORKDIR}/prelink.conf ${D}${sysconfdir}/prelink.conf - install -m 0644 ${WORKDIR}/prelink.cron.daily ${D}${sysconfdir}/cron.daily/prelink - install -m 0644 ${WORKDIR}/prelink.default ${D}${sysconfdir}/default/prelink -} diff --git a/packages/prelink/prelink_20040520.bb b/packages/prelink/prelink_20040520.bb deleted file mode 100644 index 922994ce3a..0000000000 --- a/packages/prelink/prelink_20040520.bb +++ /dev/null @@ -1,16 +0,0 @@ -SECTION = "devel" -DEPENDS = "elfutils " -DESCRIPTION = " The prelink package contains a utility which modifies ELF shared libraries \ -and executables, so that far fewer relocations need to be resolved at \ -runtime and thus programs come up faster." -LICENSE = "GPL" -SRC_URI = "ftp://people.redhat.com/jakub/prelink/prelink-${PV}.tar.bz2" -S = "${WORKDIR}/prelink" - -EXTRA_OECONF = "--disable-64bit" - -inherit autotools - -do_install_append () { - install -d ${D}${sysconfdir}/cron.daily ${D}${sysconfdir}/default -} diff --git a/packages/prelink/prelink_20040304.bb b/packages/prelink/prelink_20050901.bb index bb134fe536..a83ff1b61f 100644 --- a/packages/prelink/prelink_20040304.bb +++ b/packages/prelink/prelink_20050901.bb @@ -1,15 +1,24 @@ SECTION = "devel" -DEPENDS = "elfutils " +DEPENDS = "elfutils" DESCRIPTION = " The prelink package contains a utility which modifies ELF shared libraries \ and executables, so that far fewer relocations need to be resolved at \ runtime and thus programs come up faster." -LICENSE = "PRELINK" +LICENSE = "GPL" +PR = "r2" + SRC_URI = "${DEBIAN_MIRROR}/main/p/prelink/prelink_0.0.${PV}.orig.tar.gz \ file://prelink.conf \ file://prelink.cron.daily \ file://prelink.default" + +TARGET_OS_ORIG := "${TARGET_OS}" +OVERRIDES_append = ":${TARGET_OS_ORIG}" +SRC_URI_append_linux-gnueabi = " file://arm_eabi.patch;patch=1" + S = "${WORKDIR}/prelink-0.0.${PV}" +EXTRA_OECONF = "--disable-64bit" + inherit autotools do_install_append () { @@ -18,3 +27,20 @@ do_install_append () { install -m 0644 ${WORKDIR}/prelink.cron.daily ${D}${sysconfdir}/cron.daily/prelink install -m 0644 ${WORKDIR}/prelink.default ${D}${sysconfdir}/default/prelink } + +pkg_postinst_prelink() { +#!/bin/sh + +if [ "x$D" != "x" ]; then + exit 1 +fi + +prelink -a +} + +pkg_postrm_prelink() { +#!/bin/sh + +prelink -au +} + |