[LibOS] Add noreturn function attribute where appropriate

Add noreturn function attribute to __shim_do_execve_rtld(),
execute_elf_object(), __shim_ipc_helper(), shim_ipc_helper_end()
This commit is contained in:
Isaku Yamahata
2019-06-19 00:14:00 -07:00
committed by Dmitrii Kuvaiskii
parent 573c865bc3
commit 326fc07933
6 changed files with 16 additions and 12 deletions
+3 -3
View File
@@ -210,9 +210,9 @@ int check_elf_object (struct shim_handle * file);
int load_elf_object (struct shim_handle * file, void * addr, size_t mapped);
int load_elf_interp (struct shim_handle * exec);
int free_elf_interp (void);
void execute_elf_object (struct shim_handle * exec,
int * argcp, const char ** argp,
elf_auxv_t * auxp);
noreturn void execute_elf_object (struct shim_handle * exec,
int * argcp, const char ** argp,
elf_auxv_t * auxp);
int remove_loaded_libraries (void);
/* gdb debugging support */
+5 -3
View File
@@ -1554,9 +1554,9 @@ int register_library (const char * name, unsigned long load_address)
return 0;
}
void execute_elf_object (struct shim_handle * exec,
int * argcp, const char ** argp,
ElfW(auxv_t) * auxp)
noreturn void execute_elf_object (struct shim_handle * exec,
int * argcp, const char ** argp,
ElfW(auxv_t) * auxp)
{
struct link_map * exec_map = __search_map_by_handle(exec);
assert(exec_map);
@@ -1611,6 +1611,8 @@ void execute_elf_object (struct shim_handle * exec,
#else
# error "architecture not supported"
#endif
while (true)
/* nothing */;
}
BEGIN_CP_FUNC(library)
+2 -2
View File
@@ -805,7 +805,7 @@ next:
#define IPC_HELPER_STACK_SIZE (allocsize * 4)
#define IPC_HELPER_LIST_INIT_SIZE 32
static void shim_ipc_helper_end(struct shim_thread * self)
noreturn static void shim_ipc_helper_end(struct shim_thread * self)
{
/* Put our handle map reference */
if (self->handle_map)
@@ -831,7 +831,7 @@ static void shim_ipc_helper_end(struct shim_thread * self)
DkThreadExit();
}
static void __shim_ipc_helper (void * dummy)
noreturn static void __shim_ipc_helper (void * dummy)
{
struct shim_thread * self = get_cur_thread();
void * stack = self->stack;
+2 -3
View File
@@ -73,7 +73,7 @@ struct execve_rtld_arg
elf_auxv_t * new_auxp;
};
static void __shim_do_execve_rtld (struct execve_rtld_arg * __arg)
noreturn static void __shim_do_execve_rtld (struct execve_rtld_arg * __arg)
{
struct execve_rtld_arg arg;
memcpy(&arg, __arg, sizeof(arg));
@@ -169,8 +169,7 @@ retry_dump_vmas:
debug("execve: start execution\n");
execute_elf_object(cur_thread->exec, new_argcp, new_argp, new_auxp);
return;
/* NOTREACHED */
error:
debug("execve: failed %d\n", ret);
+2
View File
@@ -63,6 +63,8 @@ noreturn void DkProcessExit (PAL_NUM exitcode)
ENTER_PAL_CALL(DkProcessExit);
_DkProcessExit(exitcode);
_DkRaiseFailure(PAL_ERROR_NOTKILLABLE);
while (true)
/* nothing */;
LEAVE_PAL_CALL();
}
+2 -1
View File
@@ -81,7 +81,8 @@ noreturn void DkThreadExit (void)
ENTER_PAL_CALL(DkThreadExit);
_DkThreadExit();
_DkRaiseFailure(PAL_ERROR_NOTKILLABLE);
while (1) {}
while (true)
/* nothing */;
LEAVE_PAL_CALL();
}