mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 628988 part 1 - Modify elfhack test so that the executable actively calls something from the library. r=tglek,a=sdwilsh
This commit is contained in:
parent
7689402ee4
commit
78ab424e26
@ -1,3 +1,5 @@
|
||||
extern __attribute__((visibility("default"))) int print_status();
|
||||
|
||||
int main() {
|
||||
return 1;
|
||||
return print_status();
|
||||
}
|
||||
|
@ -107,6 +107,13 @@ const char *strings2[] = {
|
||||
#undef DEF
|
||||
};
|
||||
|
||||
static int ret = 1;
|
||||
|
||||
__attribute__((visibility("default"))) int print_status() {
|
||||
fprintf(stderr, "%s\n", ret ? "FAIL" : "PASS");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* On ARM, this creates a .tbss section before .init_array, which
|
||||
* elfhack could then pick instead of .init_array */
|
||||
__thread int foo;
|
||||
@ -114,19 +121,14 @@ __thread int foo;
|
||||
__attribute__((constructor)) void end_test() {
|
||||
static int count = 0;
|
||||
/* Only exit when both constructors have been called */
|
||||
if (++count == 2) {
|
||||
fprintf(stderr, "PASS\n");
|
||||
exit(0);
|
||||
}
|
||||
if (++count == 2)
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
__attribute__((constructor)) void test() {
|
||||
int i = 0, j = 0;
|
||||
#define DEF_(a,i,w) \
|
||||
if (a[i++] != str_ ## w) { \
|
||||
fprintf(stderr, "FAIL\n"); \
|
||||
exit(1); \
|
||||
}
|
||||
if (a[i++] != str_ ## w) return;
|
||||
#define DEF(w) DEF_(strings,i,w)
|
||||
#include "test.c"
|
||||
#include "test.c"
|
||||
|
Loading…
x
Reference in New Issue
Block a user