Chapter 3 79
Linker Tasks
Using Linker commands
copy %arg1,%arg3 ; Copy offset from GR25 to GR23
fdc %arg1(0,%arg0) ; Flush data cache
@SID.address+offset
loop1
addib,>,n -16,%arg1,loop1 ; Decrement offset by cache line
size
fdc %arg1(0,%arg0) ; Flush data cache
@SID.address+offset
; flush first word at addr, to handle arbitrary cache line
boundary
fdc 0(0,%arg0)
sync
fic %arg3(%sr0,%arg2) ; Flush inst cache
@SID.address+offset
loop2
addib,>,n -16,%arg3,loop2 ; Decrement offset by cache line
size
fic %arg3(%sr0,%arg2) ; Flush inst cache
@SID.address+offset
; flush first word at addr, to handle arbitrary cache line
boundary
fic 0(%sr0,%arg2)
sync
nop
nop
nop
nop
nop
nop
nop
.leave
.procend
.end
Exporting Symbols with +e
The +e option allow you to hide and export symbols. Exporting a
symbol makes the symbol a global definition, which can be accessed by
any other object modules or libraries. The +e option exports symbol and
hides from export all other global symbols not specified with +e. In
essence, -h and +e provide two different ways to do the same thing.
The syntax of the +e option is:
+e symbol
Example Using +e
Suppose you want to build a shared library from an object file that
contains the following symbol definitions as displayed by the nm
command: