Initial files

ELF/PE/Wasm
This commit is contained in:
Philip Craig
2021-08-25 13:57:54 +10:00
commit 26f9fc09c3
33 changed files with 139 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# `object-testfiles`
Binary files for use in test cases.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
printf("Hello, world");
return 0;
}
BIN
View File
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
gcc -c base.c -o base.o
gcc base.c -o base -Xlinker --hash-style=both
llvm-objcopy-6.0 --strip-sections base base.strip
aarch64-linux-gnu-gcc -c base.c -o base-aarch64.o
aarch64-linux-gnu-gcc base.c -o base-aarch64
mips64el-linux-gnuabi64-gcc -c base.c -o base-mips64el.o
mips64el-linux-gnuabi64-gcc base.c -o base-mips64el
+12
View File
@@ -0,0 +1,12 @@
struct s {
int x;
char y;
} s = { 1, 2 };
int foo() {
return s.x;
}
int bar() {
return foo();
}
BIN
View File
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
clang -target bpf -fno-addrsig -c bpf.c -o bpf.o.elf
+21
View File
@@ -0,0 +1,21 @@
typedef int (*f)(int);
inline int foo1(int x) {
return x * x;
}
inline int foo2(int x) {
return x + x;
}
f bar1(void) {
return foo1;
}
f bar2(void) {
return foo2;
}
int main() {
return 0;
}
BIN
View File
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
g++ -c comdat.cc -o comdat.o.elf
Executable
BIN
View File
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
#include <stdio.h>
static void preinit() {
printf("preinit\n");
}
static void (*const preinit_array[])()
__attribute__((section(".preinit_array"), aligned(sizeof(void *))))
= { preinit };
static void init() {
printf("init\n");
}
static void (*const init_array[])()
__attribute__((section(".init_array"), aligned(sizeof(void *))))
= { init };
static void fini() {
printf("fini\n");
}
static void (*const fini_array[])()
__attribute__((section(".fini_array"), aligned(sizeof(void *))))
= { fini };
static void ctor() {
printf("ctor\n");
}
static void (*const ctors[])()
__attribute__((section(".ctors"), aligned(sizeof(void *))))
= { ctor };
static void dtor() {
printf("dtor\n");
}
static void (*const dtors[])()
__attribute__((section(".dtors"), aligned(sizeof(void *))))
= { dtor };
int main() {
return 0;
}
BIN
View File
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
gcc -c initarray.c -o initarray.o.elf
gcc initarray.c -o initarray.elf

Some files were not shown because too many files have changed in this diff Show More