Changeset 04803bf in mainline for uspace/lib/c/rtld/symbol.c


Ignore:
Timestamp:
2011-03-21T22:00:17Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
143932e
Parents:
b50b5af2 (diff), 7308e84 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes (needs fixes).

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/rtld/symbol.c

    rb50b5af2 r04803bf  
    3737#include <stdio.h>
    3838#include <stdlib.h>
    39 #include <string.h>
     39//#include <string.h>
    4040
    4141#include <rtld.h>
     
    6060}
    6161
    62 static elf_symbol_t *def_find_in_module(char *name, module_t *m)
     62static elf_symbol_t *def_find_in_module(const char *name, module_t *m)
    6363{
    6464        elf_symbol_t *sym_table;
     
    114114 *                      that contains the symbol.
    115115 */
    116 elf_symbol_t *symbol_bfs_find(char *name, module_t *start, module_t **mod)
     116elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod)
    117117{
    118118        module_t *m, *dm;
     
    191191 *                      that contains the symbol.
    192192 */
    193 elf_symbol_t *symbol_def_find(char *name, module_t *origin, module_t **mod)
    194 {
    195         module_t *m, *dm;
    196         elf_symbol_t *sym, *s;
    197         link_t queue_head;
    198         size_t i;
     193elf_symbol_t *symbol_def_find(const char *name, module_t *origin, module_t **mod)
     194{
     195        elf_symbol_t *s;
    199196
    200197        if (origin->dyn.symbolic) {
     
    216213                /* Program is dynamic -- start with program as root. */
    217214                return symbol_bfs_find(name, runtime_env->program, mod);
    218         } else {       
     215        } else {
    219216                /* Program is static -- start with @a origin as root. */
    220217                return symbol_bfs_find(name, origin, mod);
     
    222219}
    223220
    224 uintptr_t symbol_get_addr(elf_symbol_t *sym, module_t *m)
     221void *symbol_get_addr(elf_symbol_t *sym, module_t *m)
    225222{
    226223        if (sym->st_shndx == SHN_ABS) {
    227224                /* Do not add bias to absolute symbols */
    228                 return sym->st_value;
     225                return (void *) sym->st_value;
    229226        } else {
    230                 return sym->st_value + m->bias;
     227                return (void *) (sym->st_value + m->bias);
    231228        }
    232229}
Note: See TracChangeset for help on using the changeset viewer.