Remove arch_get_caller

Use the gcc builtin instead, which generates more efficient code (it
saves a function call) and means less platform specific code to write
for us.

Change-Id: I1d55b5703027b2ea4ecde2438ea306bd4850eb32
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1859
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Jaroslaw Pelczar
2019-10-19 17:03:05 +00:00
committed by waddlesplash
parent 09fafe4c95
commit 016cc66803
11 changed files with 3 additions and 56 deletions
@@ -50,7 +50,6 @@ bigtime_t __arch_get_system_time_offset(struct real_time_data *data);
bigtime_t __get_system_time_offset(); bigtime_t __get_system_time_offset();
void __init_pwd_backend(void); void __init_pwd_backend(void);
void __reinit_pwd_backend_after_fork(void); void __reinit_pwd_backend_after_fork(void);
void* __arch_get_caller(void);
int32 __arch_get_stack_trace(addr_t* returnAddresses, int32 maxCount, int32 __arch_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
int32 skipFrames, addr_t stackBase, addr_t stackEnd); int32 skipFrames, addr_t stackBase, addr_t stackEnd);
@@ -18,10 +18,3 @@ get_stack_frame(void)
return NULL; return NULL;
} }
void*
__arch_get_caller(void)
{
// TODO: Implement!
return NULL;
}
@@ -15,10 +15,3 @@ get_stack_frame(void)
return NULL; return NULL;
} }
void*
__arch_get_caller(void)
{
// TODO: Implement!
return NULL;
}
@@ -15,10 +15,3 @@ get_stack_frame(void)
return NULL; return NULL;
} }
void*
__arch_get_caller(void)
{
// TODO: Implement!
return NULL;
}
@@ -15,11 +15,3 @@ get_stack_frame(void)
return NULL; return NULL;
} }
void*
__arch_get_caller(void)
{
// TODO: Implement!
return NULL;
}
@@ -15,11 +15,3 @@ get_stack_frame(void)
return NULL; return NULL;
} }
void*
__arch_get_caller(void)
{
// TODO: Implement!
return NULL;
}
@@ -12,10 +12,3 @@ FUNCTION(get_stack_frame):
ret ret
FUNCTION_END(get_stack_frame) FUNCTION_END(get_stack_frame)
/* void* __arch_get_caller(void); */
FUNCTION(__arch_get_caller):
mov 4(%ebp), %eax
ret
FUNCTION_END(__arch_get_caller)
@@ -13,10 +13,3 @@ FUNCTION(get_stack_frame):
ret ret
FUNCTION_END(get_stack_frame) FUNCTION_END(get_stack_frame)
/* void* __arch_get_caller(void); */
FUNCTION(__arch_get_caller):
movq 8(%rbp), %rax
ret
FUNCTION_END(__arch_get_caller)
+3 -2
View File
@@ -40,8 +40,9 @@ dlsym(void *handle, char const *name)
status_t status; status_t status;
void* caller = NULL; void* caller = NULL;
if (handle == RTLD_NEXT) if (handle == RTLD_NEXT) {
caller = __arch_get_caller(); caller = __builtin_return_address(0);
}
status = __gRuntimeLoader->get_library_symbol(handle, caller, name, status = __gRuntimeLoader->get_library_symbol(handle, caller, name,
&location); &location);
@@ -608,7 +608,6 @@ void __acosl() {}
void __acr() {} void __acr() {}
void __add() {} void __add() {}
void __allocate_pthread() {} void __allocate_pthread() {}
void __arch_get_caller() {}
void __arch_get_stack_trace() {} void __arch_get_stack_trace() {}
void __arch_get_system_time_offset() {} void __arch_get_system_time_offset() {}
void __arch_init_time() {} void __arch_init_time() {}
@@ -418,7 +418,6 @@ void __acoshl() {}
void __acosl() {} void __acosl() {}
void __adjust_heap__H3ZPQ217EnvironmentFilter5EntryZlZQ217EnvironmentFilter5Entry_X01X11X11X21_v() {} void __adjust_heap__H3ZPQ217EnvironmentFilter5EntryZlZQ217EnvironmentFilter5Entry_X01X11X11X21_v() {}
void __allocate_pthread() {} void __allocate_pthread() {}
void __arch_get_caller() {}
void __arch_get_stack_trace() {} void __arch_get_stack_trace() {}
void __arch_get_system_time_offset() {} void __arch_get_system_time_offset() {}
void __arch_init_time() {} void __arch_init_time() {}