-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* src/cache.c (prelink_save_cache_check): For ET_CACHE_DYN
or ET_UNPRELINKABLE dependencies, call prelink_save_cache_check recursively. * testsuite/Makefile.am (TESTS): Add unprel1.sh. * testsuite/Makefile.in: Regenerated. * testsuite/unprel1.sh: New test. * testsuite/unprel1.c: New file. * testsuite/unprel1lib1.c: New file. * testsuite/unprel1lib2.c: New file. git-svn-id: http://sourceware.org/svn/prelink@205 94c539fb-cf18-0410-b60f-edeeb537fa16 Signed-off-by: Mark Hatle <[email protected]>
- Loading branch information
jakub
authored and
Mark Hatle
committed
Aug 1, 2013
1 parent
fe7b11d
commit c7c6f4e
Showing
7 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
2013-05-03 Jakub Jelinek <[email protected]> | ||
|
||
* src/cache.c (prelink_save_cache_check): For ET_CACHE_DYN | ||
or ET_UNPRELINKABLE dependencies, call prelink_save_cache_check | ||
recursively. | ||
* testsuite/Makefile.am (TESTS): Add unprel1.sh. | ||
* testsuite/Makefile.in: Regenerated. | ||
* testsuite/unprel1.sh: New test. | ||
* testsuite/unprel1.c: New file. | ||
* testsuite/unprel1lib1.c: New file. | ||
* testsuite/unprel1lib2.c: New file. | ||
|
||
* src/prelink.h (R_390_IRELATIVE): Define if not defined. | ||
|
||
2013-04-25 Jakub Jelinek <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2001, 2002, 2003, 2004, 2006 Red Hat, Inc. | ||
/* Copyright (C) 2001, 2002, 2003, 2004, 2006, 2013 Red Hat, Inc. | ||
Written by Jakub Jelinek <[email protected]>, 2001. | ||
This program is free software; you can redistribute it and/or modify | ||
|
@@ -566,10 +566,14 @@ prelink_save_cache_check (struct prelink_entry *ent) | |
return 1; | ||
break; | ||
case ET_CACHE_DYN: | ||
if (prelink_save_cache_check (ent->depends[i])) | ||
return 1; | ||
break; | ||
case ET_UNPRELINKABLE: | ||
if (ent->type != ET_UNPRELINKABLE) | ||
return 1; | ||
if (prelink_save_cache_check (ent->depends[i])) | ||
return 1; | ||
break; | ||
default: | ||
return 1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
extern int bar (); | ||
|
||
int | ||
main () | ||
{ | ||
return bar () - 42; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
. `dirname $0`/functions.sh | ||
PRELINK=`echo $PRELINK \ | ||
| sed -e 's, \./\(prelink\.\(cache\|conf\)\), unprel1.tree/etc/\1,g' \ | ||
-e 's,path=\.,path=unprel1.tree/opt:unprel1.tree/lib,' \ | ||
-e 's,linker=\./,linker=unprel1.tree/lib/,'` | ||
CCLINK=`echo $CCLINK \ | ||
| sed -e 's,linker=\./,linker=unprel1.tree/lib/,'` | ||
rm -rf unprel1.tree | ||
rm -f unprel1.log | ||
mkdir -p unprel1.tree/{lib,etc,opt,bin} | ||
$CC -shared -O2 -fpic -o unprel1.tree/lib/lib1.so $srcdir/unprel1lib1.c | ||
cp -a unprel1.tree/{lib,opt}/lib1.so | ||
$CC -shared -O2 -fpic -o unprel1.tree/lib/lib2.so $srcdir/unprel1lib2.c \ | ||
-L unprel1.tree/lib -l1 | ||
$CCLINK -o unprel1.tree/bin/bin1 $srcdir/unprel1.c \ | ||
-Wl,-rpath,unprel1.tree/lib -L unprel1.tree/lib -l2 | ||
cat > unprel1.tree/etc/prelink.conf <<EOF | ||
unprel1.tree/bin | ||
unprel1.tree/lib | ||
EOF | ||
for lib in `cat syslib.list`; do | ||
cp -p $lib.orig unprel1.tree/lib/$lib | ||
cp -p $lib.orig unprel1.tree/lib/$lib.orig | ||
done | ||
for lib in `cat syslnk.list`; do | ||
cp -dp $lib unprel1.tree/lib | ||
done | ||
LIBS="unprel1.tree/lib/lib1.so unprel1.tree/lib/lib2.so" | ||
LIBS="$LIBS unprel1.tree/opt/lib1.so" | ||
BINS="unprel1.tree/bin/bin1" | ||
savelibs | ||
chmod -x unprel1.tree/bin/bin1.orig | ||
echo $PRELINK ${PRELINK_OPTS--vm} unprel1.tree/{bin,lib} > unprel1.log | ||
$PRELINK ${PRELINK_OPTS--vm} unprel1.tree/{bin,lib} >> unprel1.log 2>&1 || exit 1 | ||
grep -v 'opt/lib1.so is not present in any config file directories' unprel1.log \ | ||
| grep -v 'lib/lib2.so because its dependency unprel1.tree/opt/lib1.so could not be prelinked' \ | ||
| grep -v 'bin/bin1 because its dependency unprel1.tree/lib/lib2.so could not be prelinked' \ | ||
| grep -q ^`echo $PRELINK | sed 's/ .*$/: /'` && exit 2 | ||
grep -q 'opt/lib1.so is not present in any config file directories' \ | ||
unprel1.log || exit 3 | ||
grep -q 'lib/lib2.so because its dependency unprel1.tree/opt/lib1.so could not be prelinked' \ | ||
unprel1.log || exit 4 | ||
grep -q 'bin/bin1 because its dependency unprel1.tree/lib/lib2.so could not be prelinked' \ | ||
unprel1.log || exit 5 | ||
unprel1.tree/bin/bin1 || exit 6 | ||
# So that it is not prelinked again | ||
chmod -x unprel1.tree/bin/bin1 | ||
LIBS=unprel1.tree/lib/lib1.so | ||
BINS= | ||
comparelibs >> unprel1.log 2>&1 || exit 7 | ||
for i in unprel1.tree/lib/lib2.so unprel1.tree/opt/lib1.so unprel1.tree/bin/bin1; do | ||
cmp -s $i $i.orig || exit 8 | ||
done | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
int | ||
baz () | ||
{ | ||
return 42; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
extern int baz (); | ||
|
||
int | ||
bar () | ||
{ | ||
return baz (); | ||
} |