Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1c3c287 in mainline


Ignore:
Timestamp:
2019-01-14T16:52:47Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
d4ceba0
Parents:
8e3bc063
git-author:
Jiri Svoboda <jiri@…> (2018-01-19 19:52:43)
git-committer:
Jiri Svoboda <jiri@…> (2019-01-14 16:52:47)
Message:

Dynamic linking on sparc64

Files:
5 added
10 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    r8e3bc063 r1c3c287  
    578578
    579579% Dynamic linking support
    580 ! [PLATFORM=amd64|PLATFORM=ia32] CONFIG_RTLD (y/n)
    581 ! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=riscv64|PLATFORM=sparc64] CONFIG_RTLD (n)
     580! [PLATFORM=amd64|PLATFORM=ia32|PLATFORM=sparc64] CONFIG_RTLD (y/n)
     581! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=ppc32|PLATFORM=riscv64] CONFIG_RTLD (n)
    582582
    583583% Build shared libraries
  • defaults/sparc64/niagara/Makefile.config

    r8e3bc063 r1c3c287  
    1414CONFIG_FB = n
    1515
     16# Dynamic linking support
     17CONFIG_RTLD = y
     18
     19# Build shared libraries
     20CONFIG_BUILD_SHARED_LIBS = y
     21
     22# Link against shared libraries
     23CONFIG_USE_SHARED_LIBS = y
     24
    1625# Barebone build with essential binaries only
    1726CONFIG_BAREBONE = y
  • defaults/sparc64/ultra/Makefile.config

    r8e3bc063 r1c3c287  
    88QUADFLOAT = hard
    99
     10# Dynamic linking support
     11CONFIG_RTLD = y
     12
     13# Build shared libraries
     14CONFIG_BUILD_SHARED_LIBS = y
     15
     16# Link against shared libraries
     17CONFIG_USE_SHARED_LIBS = y
     18
    1019# Barebone build with essential binaries only
    1120CONFIG_BAREBONE = y
  • uspace/lib/c/arch/amd64/src/rtld/dynamic.c

    r8e3bc063 r1c3c287  
    2727 */
    2828
    29 /** @addtogroup libcia32
     29/** @addtogroup libcamd64
    3030 * @brief
    3131 * @{
  • uspace/lib/c/arch/sparc64/Makefile.common

    r8e3bc063 r1c3c287  
    5252ifeq ($(PROCESSOR),sun4v)
    5353        DEFS += -DSUN4V
     54        COMMON_CFLAGS += -Wl,-z,max-page-size=0x2000
     55else
     56        COMMON_CFLAGS += -Wl,-z,max-page-size=0x4000
    5457endif
  • uspace/lib/c/arch/sparc64/Makefile.inc

    r8e3bc063 r1c3c287  
    3333        arch/$(UARCH)/src/tls.c \
    3434        arch/$(UARCH)/src/stacktrace.c \
    35         arch/$(UARCH)/src/stacktrace_asm.S
     35        arch/$(UARCH)/src/stacktrace_asm.S \
     36        arch/$(UARCH)/src/rtld/dynamic.c \
     37        arch/$(UARCH)/src/rtld/reloc.c
    3638
    3739ARCH_AUTOCHECK_HEADERS = \
  • uspace/lib/c/arch/sparc64/include/libarch/tls.h

    r8e3bc063 r1c3c287  
    4646        void *self;
    4747        void *fibril_data;
     48        void **dtv;
     49        void *pad;
    4850} tcb_t;
    4951
  • uspace/lib/c/arch/sparc64/src/tls.c

    r8e3bc063 r1c3c287  
    3838#include <stddef.h>
    3939
     40#ifdef CONFIG_RTLD
     41#include <rtld/rtld.h>
     42#endif
     43
    4044tcb_t *tls_alloc_arch(size_t size, size_t align)
    4145{
     
    4852}
    4953
     54/*
     55 * Rtld TLS support
     56 */
     57
     58typedef struct {
     59        unsigned long int ti_module;
     60        unsigned long int ti_offset;
     61} tls_index;
     62
     63void *__tls_get_addr(tls_index *ti);
     64
     65void *__tls_get_addr(tls_index *ti)
     66{
     67        uint8_t *tls;
     68
     69#ifdef CONFIG_RTLD
     70        if (runtime_env != NULL) {
     71                return rtld_tls_get_addr(runtime_env, __tcb_get(),
     72                    ti->ti_module, ti->ti_offset);
     73        }
     74#endif
     75        /* Get address of static TLS block */
     76        tls = tls_get();
     77        return tls + ti->ti_offset;
     78}
     79
    5080/** @}
    5181 */
  • uspace/lib/c/generic/elf/elf_mod.c

    r8e3bc063 r1c3c287  
    420420        seg_ptr = (void *) seg_addr;
    421421
    422         DPRINTF("Load segment at addr %p, size 0x%zx, flags %c%c%c\n", (void *) seg_addr,
     422        DPRINTF("Load segment v_addr=0x%zx at addr %p, size 0x%zx, flags %c%c%c\n",
     423            entry->p_vaddr,
     424            (void *) seg_addr,
    423425            entry->p_memsz,
    424426            (entry->p_flags & PF_R) ? 'r' : '-',
     
    430432                    (seg_addr % entry->p_align)) {
    431433                        DPRINTF("Align check 1 failed offset%%align=0x%zx, "
    432                             "vaddr%%align=0x%zx\n",
     434                            "vaddr%%align=0x%zx align=0x%zx\n",
    433435                            entry->p_offset % entry->p_align,
    434                             seg_addr % entry->p_align);
     436                            seg_addr % entry->p_align, entry->p_align);
    435437                        return EE_INVALID;
    436438                }
  • uspace/lib/c/include/smc.h

    r8e3bc063 r1c3c287  
    3636#define LIBC_SMC_H_
    3737
     38#include <errno.h>
    3839#include <stddef.h>
    3940
Note: See TracChangeset for help on using the changeset viewer.