Skip to content

Commit

Permalink
* config/score/crti.asm: add pic support.
Browse files Browse the repository at this point in the history
        * config/score/crtn.asm: add pic support.
        * config/score/score.h: remove builtin_define("__pic__").
        * config/score/score.c: add TARGET_RTX_COST macro.
        * config/score/score.md: PIC support for call/sibcall pattern.
        * config/score/mul-div.S: add pic support.
        * config/score/t-score-elf: update MULTILIB_OPTIONS.
        * ChangeLog: add shengguo as another score maintainer.
        * config.sub: add score support in it.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117771 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
liqin committed Oct 16, 2006
1 parent 22ae655 commit de79ba9
Show file tree
Hide file tree
Showing 9 changed files with 645 additions and 181 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2006-10-16 Tan Shengguo <shengguo@sunnorth.com.cn>

* MAINTAINERS: Add Tan Shengguo as score port maintainer.

2006-10-10 Brooks Moses <bmoses@stanford.edu>

* Makefile.def: Added pdf target handling.
Expand Down
4 changes: 4 additions & 0 deletions config.sub
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,10 @@ case $basic_machine in
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
score | score-*)
basic_machine=score-sunplus
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
Expand Down
60 changes: 59 additions & 1 deletion gcc/config/score/crti.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
# This file makes a stack frame for the contents of the .init and
# .fini sections.

.section .init,"ax", @progbits
#ifndef __pic__
.section .init, "ax", @progbits
.weak _start
.ent _start
.frame r0, 0, r3, 0
Expand Down Expand Up @@ -81,5 +82,62 @@ _init:
_fini:
addi r0, -32
sw r3, [r0, 20]
#else
.section .init, "ax", @progbits
.set pic
.weak _start
.ent _start
.frame r0, 0, r3, 0
.mask 0x00000000,0
_start:
la r28, _gp
la r8, __bss_start
la r9, __bss_end__
sub! r9, r8
srli! r9, 2
addi r9, -1
mtsr r9, sr0
li r9, 0
1:
sw r9, [r8]+, 4
bcnz 1b
la r0, _stack
# jl _init
# la r4, _end
# jl _init_argv
ldiu! r4, 0
ldiu! r5, 0
# jl main
la r29, main
brl r29
# jl exit
la r29, exit
brl r29
.end _start

.weak _init_argv
.ent
.frame r0, 0, r3, 0
.mask 0x00000000, 0
_init_argv:
ldiu! r4, 0
ldiu! r5, 0
j main
.end _init_argv

.globl _init
.type _init, %function
_init:
addi r0, -32
sw r3, [r0, 20]

.section .fini, "ax", @progbits
.globl _fini
.type _fini, %function
_fini:
addi r0, -32
sw r3, [r0, 20]

#endif


15 changes: 15 additions & 0 deletions gcc/config/score/crtn.asm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# This file makes sure that the .init and .fini sections do in
# fact return.

#ifndef __pic__
.section .init, "ax", @progbits
lw r3, [r0, 20]
addi r0, 32
Expand All @@ -44,4 +45,18 @@
lw r3, [r0, 20]
addi r0, 32
br r3
#else
.set pic
.section .init, "ax", @progbits
lw r3, [r0, 20]
addi r0, 32
br r3

.set pic
.section .fini, "ax", @progbits
lw r3, [r0, 20]
addi r0, 32
br r3
#endif


Loading

0 comments on commit de79ba9

Please sign in to comment.