forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-util/ltrace: fix print-instruction-pointer test
print-instruction-pointer occasionally fails when kernel loads test at address that does not match last 4 digits of 'objdump' output. On x86_64 page size is 4096 bytes (0x1000). This gives only 3 digits of stable address. The change picks last 3 digits from objdump address. Signed-off-by: Sergei Trofimovich <[email protected]> Package-Manager: Portage-2.3.50, Repoman-2.3.11
- Loading branch information
Sergei Trofimovich
committed
Oct 4, 2018
1 parent
395ed52
commit f1e6f16
Showing
2 changed files
with
17 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- a/testsuite/ltrace.minor/print-instruction-pointer.exp | ||
+++ b/testsuite/ltrace.minor/print-instruction-pointer.exp | ||
@@ -32,6 +32,12 @@ catch "exec sh -c {objdump -d $objdir/$subdir/$binfile | sed -n '/^\[0-9a-fA-F\] | ||
catch "exec sh -c {echo \"$output\" | sed -n '2p'| awk -F' ' '{print \$1}'|awk -F: '{print \$1}'}" addr1 | ||
catch "exec sh -c {echo \"$output\" | sed -n '5p'| awk -F' ' '{print \$1}'|awk -F: '{print \$1}'}" addr2 | ||
|
||
+# Pick at most last 3 digits: | ||
+# PIE binaries randomize address on page level. | ||
+# Let's assume page size is no bigger than 4096 (3 hex digits) | ||
+set addr1 [string range $addr1 3 end] | ||
+set addr2 [string range $addr2 3 end] | ||
+ | ||
verbose "addr1 = $addr1" | ||
verbose "addr2 = $addr2" | ||
# Verify the output by checking numbers of print in main.ltrace. |
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