Changeset a71d9af9 in mainline


Ignore:
Timestamp:
2006-03-24T00:51:14Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86d05fae
Parents:
e708063
Message:

Changed MIPS to compile as PIC code.

Location:
libc/arch/mips32
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libc/arch/mips32/Makefile.inc

    re708063 ra71d9af9  
    3232TARGET = mipsel-linux-gnu
    3333TOOLCHAIN_DIR = /usr/local/mipsel/bin
    34 CFLAGS += -mips3 -mno-abicalls
     34CFLAGS += -mips3
    3535
    3636ARCH_SOURCES += arch/$(ARCH)/src/syscall.c \
    3737        arch/$(ARCH)/src/psthread.S
    3838
    39 LFLAGS += -N
    4039
  • libc/arch/mips32/_link.ld.in

    re708063 ra71d9af9  
    1818        } :text
    1919
    20         .data ALIGN(0x4000) : SUBALIGN(0x4000) {
     20        .data : {
    2121                *(.data);
     22                *(.data.rel*);
    2223        } :data
    2324        .got : {
    2425                _gp = .;
    25                 *(.data.rel*);
     26                *(.got);
    2627        } :data
    2728        .sbss : {
  • libc/arch/mips32/include/psthread.h

    re708063 ra71d9af9  
    3232#include <types.h>
    3333
    34 #define SP_DELTA        (8)
     34/* +16 is just for sure that the called function
     35 * have space to store it's arguments
     36 */
     37#define SP_DELTA        (8+16)
    3538
    3639typedef struct  {
  • libc/arch/mips32/src/entry.s

    re708063 ra71d9af9  
    2828
    2929.text
    30 
    31 .org 0
    32 
    3330.section .init, "ax"
    34 .globl __start
     31.global __start
     32.set noreorder
     33.option pic2
    3534
    3635## User-space task entry point
     
    3938.ent __start
    4039__start:
    41         lui $28, _gp
     40        .frame $sp, 32, $31
     41        .cpload $25
    4242       
    43         # Mips o32 may store its arguments on stack, make space,
     43       
     44        # Mips o32 may store its arguments on stack, make space (16 bytes),
    4445        # so that it could work with -O0
    45         addiu $sp, -16
     46        # Make space additional 16 bytes for the stack frame
     47
     48        addiu $sp, -32
     49        .cprestore 16   # Allow PIC code
    4650       
    4751        jal __main
     52        nop
    4853       
    4954        jal main
     55        nop
    5056       
    5157        jal __exit
     58        nop
    5259       
    5360.end __start
     61
     62# Alignment of output section data to 0x4000
     63.section .data
     64.align 14
  • libc/arch/mips32/src/psthread.S

    re708063 ra71d9af9  
    3131.set noat
    3232.set noreorder
    33 .set nomacro
    3433
    3534
     
    8483        CONTEXT_LOAD $a0
    8584
     85        # Just for the jump into first function, but one instruction
     86        # should not bother us
     87        move $t9, $ra   
    8688        # context_restore returns 0
    8789        j $ra
    8890        xor $v0, $v0   
     91
  • libc/arch/mips32/src/thread_entry.s

    re708063 ra71d9af9  
    2828
    2929.text
    30 
     30       
    3131.set noat
    3232.set noreorder
    33 .set nomacro
    34 
     33.option pic2
     34       
    3535.globl __thread_entry
    3636
     
    4040.ent __thread_entry
    4141__thread_entry:
    42         lui $28, _gp
     42        .frame $sp, 32, $31
     43        .cpload $25
    4344
    4445        #
     
    4748        add $4, $2, 0
    4849        # Mips o32 may store its arguments on stack, make space
    49         addiu $sp, -16
     50        addiu $sp, -32
     51        .cprestore 16
    5052       
    51         j __thread_main
     53        jal __thread_main
    5254        nop
    5355               
Note: See TracChangeset for help on using the changeset viewer.