From 3fb0949b85fe14170fb555da9262f3b306e9ddaf Mon Sep 17 00:00:00 2001 From: Crabtux Date: Fri, 15 Mar 2024 14:45:57 +0800 Subject: [PATCH] Add test for fixupSharedReturnJumpToRelocs --- test/bins/Makefile | 5 ++++- test/bins/sharedReturn.c | 13 +++++++++++++ test/bins/sharedReturn.o | Bin 0 -> 1512 bytes 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/bins/sharedReturn.c create mode 100644 test/bins/sharedReturn.o diff --git a/test/bins/Makefile b/test/bins/Makefile index 50eef138..ba130e5a 100644 --- a/test/bins/Makefile +++ b/test/bins/Makefile @@ -3,7 +3,7 @@ all: .PHONY: clean clean: - rm -fv dectest32 dectest64 rec + rm -fv dectest32 dectest64 rec sharedReturn.o dectest32: dectest.c types.h gcc -m32 -fno-pic -no-pie -fno-omit-frame-pointer -o dectest32 -O0 dectest.c @@ -22,3 +22,6 @@ rec: rec.c types_rec.h strings: strings.c gcc -m64 -fno-pic -no-pie -fno-omit-frame-pointer -o strings -O0 strings.c + +sharedReturn.o: sharedReturn.c + gcc -m64 -fno-pic -no-pie -fno-omit-frame-pointer -fno-inline -o sharedReturn.o -O2 -c sharedReturn.c diff --git a/test/bins/sharedReturn.c b/test/bins/sharedReturn.c new file mode 100644 index 00000000..b7ec2a11 --- /dev/null +++ b/test/bins/sharedReturn.c @@ -0,0 +1,13 @@ +#include + +int getNum(void); +int calc(int a, int b); + +int main(void){ + int c = getNum(); + + if (c > 2) + return calc(c, 2); + else + return 0; +} \ No newline at end of file diff --git a/test/bins/sharedReturn.o b/test/bins/sharedReturn.o new file mode 100644 index 0000000000000000000000000000000000000000..9abf334e9bb2970c60ac79fb958a8151e3390e8d GIT binary patch literal 1512 zcmbtSO-md>5Um+EYT^g0MhFR27W zOcy%ZzXU&Ti^!p@%lk|j)9D_s9o(esGW8j zlr@K15sG4MU8e;qZYGIIQI161iF#Z-jNkzvnY;!Op0DJj=@pZ%{&P#1R$;H0*6LKTC?#(3TU9R!_ zlKz>776!DZUw_4dh`l(!{s4)h`}@X?%01EjJ;WvTf)|}lXZ7fVcF}h*j-F=3uctlz d*`bmypFdAY&KSN!rZ6h1@3HXsPT3Fq`acrdZ5;pr literal 0 HcmV?d00001