aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/tst-tlsmod2.c6
-rw-r--r--elf/tst-tlsmod3.c9
-rw-r--r--elf/tst-tlsmod4.c6
3 files changed, 17 insertions, 4 deletions
diff --git a/elf/tst-tlsmod2.c b/elf/tst-tlsmod2.c
index 6aec812..1a4c73b 100644
--- a/elf/tst-tlsmod2.c
+++ b/elf/tst-tlsmod2.c
@@ -12,9 +12,13 @@ COMMON_INT_DEF(foo);
int
in_dso (int n, int *caller_foop)
{
- int *foop = TLS_GD (foo);
+ int *foop;
int result = 0;
+ puts ("foo"); /* Make sure PLT is used before macros. */
+
+ foop = TLS_GD (foo);
+
if (caller_foop != NULL && foop != caller_foop)
{
printf ("callers address of foo differs: %p vs %p\n", caller_foop, foop);
diff --git a/elf/tst-tlsmod3.c b/elf/tst-tlsmod3.c
index 087c11b..6b7fbcc 100644
--- a/elf/tst-tlsmod3.c
+++ b/elf/tst-tlsmod3.c
@@ -15,10 +15,15 @@ COMMON_INT_DEF(comm_n);
int
in_dso2 (void)
{
- int *foop = TLS_GD (foo);
+ int *foop;
int result = 0;
static int n;
- int *np = TLS_GD (comm_n);
+ int *np;
+
+ puts ("foo"); /* Make sure PLT is used before macros. */
+
+ foop = TLS_GD (foo);
+ np = TLS_GD (comm_n);
if (n != *np)
{
diff --git a/elf/tst-tlsmod4.c b/elf/tst-tlsmod4.c
index d40b3fd..c536303 100644
--- a/elf/tst-tlsmod4.c
+++ b/elf/tst-tlsmod4.c
@@ -12,9 +12,13 @@ COMMON_INT_DEF(baz);
int
in_dso (int n, int *caller_bazp)
{
- int *bazp = TLS_GD (baz);
+ int *bazp;
int result = 0;
+ puts ("foo"); /* Make sure PLT is used before macros. */
+
+ bazp = TLS_GD (baz);
+
if (caller_bazp != NULL && bazp != caller_bazp)
{
printf ("callers address of baz differs: %p vs %p\n", caller_bazp, bazp);