2 Handle indirect symbols.
4 BFD supplies symbols to be indirected with the BFD_INDIRECT bit
5 set. Whenever the linker gets one of these, it calls add_indirect
6 with the symbol. We create an entry into the ldsym hash table as if it
7 were a normal symbol, but with the SYM_INDIRECT bit set in the
10 When it comes time to tie up the symbols at a later date, the flag
11 will be seen and a call made to do the right thing (tm)
22 extern ld_config_type config
;
24 DEFUN(add_indirect
,(ptr
),
27 if (config
.relocateable_output
== false) {
28 ldsym_type
*sp
= ldsym_get((*ptr
)->name
);
29 sp
->flags
|= SYM_INDIRECT
;
30 sp
->sdefs_chain
= ptr
;
37 DEFUN(do_indirect
,(ptr
),
40 if (config
.relocateable_output
== false) {
41 /* Dig out the symbol were indirecting to. It's held in the value
46 CONST
char *name
= ((asymbol
*)(*(ptr
->sdefs_chain
))->value
)->name
;
48 ldsym_type
*new = ldsym_get(name
);
50 /* We have to make a copy of the sdefs_chain item name, since
51 symbols will be clobbered on writing, and we want to write the
55 ptr
->sdefs_chain
[0][0] = new->sdefs_chain
[0][0];
56 ptr
->sdefs_chain
[0][0].name
= name
;
This page took 0.031077 seconds and 5 git commands to generate.