mirror of
https://github.com/encounter/object-testfiles.git
synced 2026-07-10 12:18:40 -07:00
Initial files
ELF/PE/Wasm
This commit is contained in:
Executable
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,6 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("Hello, world");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
BIN
Binary file not shown.
@@ -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
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
struct s {
|
||||||
|
int x;
|
||||||
|
char y;
|
||||||
|
} s = { 1, 2 };
|
||||||
|
|
||||||
|
int foo() {
|
||||||
|
return s.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
int bar() {
|
||||||
|
return foo();
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
clang -target bpf -fno-addrsig -c bpf.c -o bpf.o.elf
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
g++ -c comdat.cc -o comdat.o.elf
|
||||||
Executable
BIN
Binary file not shown.
@@ -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;
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -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
Reference in New Issue
Block a user