Changeset eefdd7c in mainline


Ignore:
Timestamp:
2019-01-20T10:02:08Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f13e19
Parents:
a131536d
Message:

Dynamic linking for ppc32

Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    ra131536d reefdd7c  
    578578
    579579% Dynamic linking support
    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)
     580! [PLATFORM=amd64|PLATFORM=ia32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_RTLD (y/n)
     581! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=riscv64] CONFIG_RTLD (n)
    582582
    583583% Build shared libraries
  • uspace/lib/c/arch/ppc32/Makefile.common

    ra131536d reefdd7c  
    3333endif
    3434
    35 COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32
     35COMMON_CFLAGS += -mcpu=powerpc -m$(FLOATS)-float -m32 -Wl,-z,max-page-size=0x1000
    3636AFLAGS += -a32
    3737LDFLAGS += -Wl,--gc-sections
  • uspace/lib/c/arch/ppc32/Makefile.inc

    ra131536d reefdd7c  
    3434        arch/$(UARCH)/src/tls.c \
    3535        arch/$(UARCH)/src/stacktrace.c \
    36         arch/$(UARCH)/src/stacktrace_asm.S
     36        arch/$(UARCH)/src/stacktrace_asm.S \
     37        arch/$(UARCH)/src/rtld/dynamic.c \
     38        arch/$(UARCH)/src/rtld/reloc.c
    3739
    3840ARCH_AUTOCHECK_HEADERS = \
  • uspace/lib/c/arch/ppc32/include/libarch/tls.h

    ra131536d reefdd7c  
    4343
    4444typedef struct {
     45        void **dtv;
     46        void *pad;
    4547        void *fibril_data;
    4648} tcb_t;
  • uspace/lib/c/arch/ppc32/src/tls.c

    ra131536d reefdd7c  
    11/*
     2 * Copyright (c) 2019 Jiri Svoboda
    23 * Copyright (c) 2006 Ondrej Palkovsky
    34 * All rights reserved.
     
    3637#include <stddef.h>
    3738
     39#ifdef CONFIG_RTLD
     40#include <rtld/rtld.h>
     41#endif
     42
    3843tcb_t *tls_alloc_arch(size_t size, size_t align)
    3944{
     
    4651}
    4752
     53/*
     54 * Rtld TLS support
     55 */
     56
     57typedef struct {
     58        unsigned long int ti_module;
     59        unsigned long int ti_offset;
     60} tls_index;
     61
     62int __tls_debug = 0;
     63
     64void *__tls_get_addr(tls_index *ti);
     65
     66void *__tls_get_addr(tls_index *ti)
     67{
     68        uint8_t *tls;
     69
     70#ifdef CONFIG_RTLD
     71        if (runtime_env != NULL) {
     72                return rtld_tls_get_addr(runtime_env, __tcb_get(),
     73                    ti->ti_module, ti->ti_offset) + 0x8000;
     74        }
     75#endif
     76        /* Get address of static TLS block */
     77        tls = tls_get();
     78        return tls + ti->ti_offset + 0x8000;
     79}
     80
    4881/** @}
    4982 */
Note: See TracChangeset for help on using the changeset viewer.