From 768b82c6de24e480267c4c251c440edfc71800e3 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 25 May 2015 19:15:17 -0400 Subject: move call to dynamic linker stage-3 into stage-2 function this move eliminates a duplicate "by-hand" symbol lookup loop from the stage-1 code and replaces it with a call to find_sym, which can be used once we're in stage 2. it reduces the size of the stage 1 code, which is helpful because stage 1 will become the crt start file for static-PIE executables, and it will allow stage 3 to access stage 2's automatic storage, which will be important in an upcoming commit. --- src/ldso/dlstart.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/ldso/dlstart.c') diff --git a/src/ldso/dlstart.c b/src/ldso/dlstart.c index 5f84465c..3aaa200f 100644 --- a/src/ldso/dlstart.c +++ b/src/ldso/dlstart.c @@ -84,16 +84,7 @@ void _dlstart_c(size_t *sp, size_t *dynv) && s[3]=='l' && s[4]=='s' && s[5]=='2' && !s[6]) break; } - ((stage2_func)(base + syms[i].st_value))(base); - - /* Call dynamic linker stage-3, __dls3 */ - for (i=0; ;i++) { - const char *s = strings + syms[i].st_name; - if (s[0]=='_' && s[1]=='_' && s[2]=='d' - && s[3]=='l' && s[4]=='s' && s[5]=='3' && !s[6]) - break; - } - ((stage3_func)(base + syms[i].st_value))(sp); + ((stage2_func)(base + syms[i].st_value))(base, sp); } #endif -- cgit v1.2.1