X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=meta-agl-profile-core%2Frecipes-devtools%2Fvalgrind%2Fvalgrind%2F0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch;fp=meta-agl-profile-core%2Frecipes-devtools%2Fvalgrind%2Fvalgrind%2F0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch;h=fa1344c8539a60f3ef4401240b24ee853a2690a5;hb=16d03b87304e2bcb01d97a560caf80ecd1d5afda;hp=0000000000000000000000000000000000000000;hpb=66d9349794b11b0bb557028e7aa084ea1246985a;p=AGL%2Fmeta-agl.git diff --git a/meta-agl-profile-core/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch b/meta-agl-profile-core/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch new file mode 100644 index 000000000..fa1344c85 --- /dev/null +++ b/meta-agl-profile-core/recipes-devtools/valgrind/valgrind/0003-tests-seg_override-Replace-__modify_ldt-with-syscall.patch @@ -0,0 +1,68 @@ +From d103475875858ab8a2e6b53ce178bb2f63883d4c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 5 Jul 2017 17:37:56 -0700 +Subject: [PATCH 3/3] tests/seg_override: Replace __modify_ldt() with syscall() + +__modify_ldt() is specific to glibc, replacing it with syscall() +makes it more portable. + +Signed-off-by: Khem Raj +--- +Upstream-Status: Submitted + + none/tests/x86-linux/seg_override.c | 15 ++++++--------- + 1 file changed, 6 insertions(+), 9 deletions(-) + +diff --git a/none/tests/x86-linux/seg_override.c b/none/tests/x86-linux/seg_override.c +index b7619c9..c89874b 100644 +--- a/none/tests/x86-linux/seg_override.c ++++ b/none/tests/x86-linux/seg_override.c +@@ -2,6 +2,8 @@ + #include + #include + #include ++#include ++#include + + /* Stuff from Wine. */ + +@@ -52,14 +54,11 @@ inline static unsigned int wine_ldt_get_limit( const LDT_ENTRY *ent ) + /* our copy of the ldt */ + LDT_ENTRY ldt_copy[8192]; + +-/* System call to set LDT entry. */ +-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); +-extern int __modify_ldt (int, void *, size_t); +- + void print_ldt ( void ) + { + int res; +- res = __modify_ldt( 0, ldt_copy, 8192*sizeof(LDT_ENTRY) ); ++ /* System call to set LDT entry. */ ++ res = syscall(SYS_modify_ldt, 0, ldt_copy, 8192*sizeof(LDT_ENTRY) ); + printf("got %d bytes\n", res ); + perror("error is"); + } +@@ -83,9 +82,6 @@ struct modify_ldt_ldt_s + unsigned int empty:25; + }; + +-/* System call to set LDT entry. */ +-//extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); +- + void set_ldt1 ( void* base ) + { + int stat; +@@ -102,7 +98,8 @@ void set_ldt1 ( void* base ) + ldt_entry.read_exec_only = 0; + ldt_entry.limit_in_pages = 0; + ldt_entry.seg_not_present = 0; +- stat = __modify_ldt (1, &ldt_entry, sizeof (ldt_entry)); ++ /* System call to set LDT entry. */ ++ stat = syscall(SYS_modify_ldt, 1, &ldt_entry, sizeof (ldt_entry)); + printf("stat = %d\n", stat); + } + +-- +2.13.2 +