Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix copy relocations handling of unique objects.
- Loading branch information
Ulrich Drepper
committed
Mar 10, 2011
1 parent
908ea63
commit 028478f
Showing
9 changed files
with
85 additions
and
9 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
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
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,23 @@ | ||
#include "tst-unique3.h" | ||
#include <cstdio> | ||
#include "../dlfcn/dlfcn.h" | ||
|
||
int t = S<char>::i; | ||
|
||
int | ||
main (void) | ||
{ | ||
std::printf ("%d %d\n", S<char>::i, t); | ||
int result = S<char>::i++ != 1 || t != 1; | ||
result |= in_lib (); | ||
void *d = dlopen ("$ORIGIN/tst-unique3lib2.so", RTLD_LAZY); | ||
int (*fp) (); | ||
if (d == NULL || (fp = (int(*)()) dlsym (d, "in_lib2")) == NULL) | ||
{ | ||
std::printf ("failed to get symbol in_lib2\n"); | ||
return 1; | ||
} | ||
result |= fp (); | ||
dlclose (d); | ||
return result; | ||
} |
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,8 @@ | ||
// BZ 12510 | ||
template<typename T> | ||
struct S | ||
{ | ||
static int i; | ||
}; | ||
|
||
extern int in_lib (void); |
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,11 @@ | ||
#include <cstdio> | ||
#include "tst-unique3.h" | ||
template<typename T> int S<T>::i = 1; | ||
static int i = S<char>::i; | ||
|
||
int | ||
in_lib (void) | ||
{ | ||
std::printf ("in_lib: %d %d\n", S<char>::i, i); | ||
return S<char>::i++ != 2 || i != 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <cstdio> | ||
#include "tst-unique3.h" | ||
|
||
template<typename T> int S<T>::i; | ||
|
||
extern "C" | ||
int | ||
in_lib2 () | ||
{ | ||
std::printf ("in_lib2: %d\n", S<char>::i); | ||
return S<char>::i != 3; | ||
} |
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,3 @@ | ||
#include_next <bits/dlfcn.h> | ||
|
||
extern void _dl_mcount_wrapper_check (void *__selfpc); | ||
libc_hidden_proto (_dl_mcount_wrapper_check) |