Skip to content

Commit

Permalink
Drop unused test blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkozlowski committed Jul 28, 2023
1 parent 4640a0a commit f5ca27c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 50 deletions.
16 changes: 0 additions & 16 deletions arch/arm/enter.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ static void __attribute__((used)) container(void)
* control back to the main program.
*/

/* this one just says hi to stdout for testing blob execution */
asm volatile(
".global test_blob \n"
"test_blob: \n"
"mov r7, #4 \n" /* __NR_write */
"mov r0, #1 \n" /* @fd */
"adr r1, _string \n" /* @buf */
"mov r2, #20 \n" /* @count */
"svc 0 \n"
"udf #16 \n" /* SIGTRAP */
"_string: .ascii \"BLOB: hello, world!\\n\" \n"
".global test_blob_size \n"
"test_blob_size: \n"
".int test_blob_size - test_blob \n"
);

/* rt_sigprocmask(), expects pointer to area for masks in r8 */
asm volatile(
".global sigprocmask_blob \n"
Expand Down
16 changes: 0 additions & 16 deletions arch/arm64/enter.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@ static void __attribute__((used)) container(void)
* control back to the main program.
*/

/* this one just says hi to stdout for testing blob execution */
asm volatile(
".global test_blob \n"
"test_blob: \n"
"mov x8, #64 \n" /* __NR_write */
"mov x0, #1 \n" /* @fd */
"adr x1, _string \n" /* @buf */
"mov x2, #20 \n" /* @count */
"svc #0 \n"
"brk #0 \n" /* SIGTRAP */
"_string: .ascii \"BLOB: hello, world!\\n\" \n"
".global test_blob_size \n"
"test_blob_size: \n"
".int test_blob_size - test_blob \n"
);

/* rt_sigprocmask(), expects pointer to area for masks in x10 */
asm volatile(
".global sigprocmask_blob \n"
Expand Down
15 changes: 0 additions & 15 deletions arch/x86_64/enter.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ static void __attribute__((used)) container(void)
* control back to the main program.
*/

/* this one just says hi to stdout for testing blob execution */
asm volatile(
".global test_blob \n"
"test_blob: \n"
"movq $1, %rax \n" /* __NR_write */
"movq $1, %rdi \n" /* @fd */
"leaq 1f(%rip), %rsi \n" /* @buf: "hello..." */
"movq $20, %rdx \n" /* @count */
"syscall \n"
"int $0x03 \n"
"1: .ascii \"BLOB: hello, world!\\n\" \n"
".global test_blob_size \n"
"test_blob_size: \n"
".int test_blob_size - test_blob \n");

/* rt_sigprocmask(), expects pointer to area for masks in %r15 */
asm volatile(
".global sigprocmask_blob \n"
Expand Down
5 changes: 2 additions & 3 deletions memcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,11 +1839,10 @@ static int ctx_save(pid_t pid)
ctx.pid = pid;

/* allocate space to save original code */
ctx.code_size = DIV_ROUND_UP(MAX(test_blob_size,
MAX(sigprocmask_blob_size,
ctx.code_size = DIV_ROUND_UP(MAX(sigprocmask_blob_size,
MAX(mmap_blob_size,
MAX(clone_blob_size,
munmap_blob_size)))),
munmap_blob_size))),
sizeof(unsigned long));

ctx.code = malloc(sizeof(unsigned long) * ctx.code_size);
Expand Down

0 comments on commit f5ca27c

Please sign in to comment.