Hi,
maybe there is a misunderstanding in the use of the MIPSpro
".weakext" here. It seems to me that you need to back up every
weak declaration by an global one. This is [apparently] not the
case in the mips-irix-6 port [or the way it is used for virtual
tables].
Take this mips assembly file:
% more bla.s
.data
.weakext i
.weakext i11,i1
.weakext i22,i2
i:
.word 0
i1:
.word 0
.globl i2
i2:
.word 0
.globl i3
.weakext i3
i3:
.word 0
.ent bla
bla:
.text
.weakext j
j:
.globl k
k:
.weakext l,k
.end
% as -c bla.s
% nm bla.o
Symbols from bla.o:
[Index] Value Size Type Bind Other Shndx Name
[1] | 0| 0|SECT |LOCL |DEFAULT |4 |.text
[2] | 0| 0|SECT |LOCL |DEFAULT |5 |.data
[3] | 8| 4|OBJT |GLOB |DEFAULT |5 |i2
[4] | 12| 4|OBJT |WEAK |DEFAULT |5 |i3
[5] | 8| 0|OBJT |WEAK |DEFAULT |5 |i22
[6] | 0| 0|FUNC |GLOB |DEFAULT |4 |k
[7] | 0| 0|FUNC |WEAK |DEFAULT |4 |l
[8] | 16| 0|FUNC |LOCL |DEFAULT |5 |bla
The only weak symbols [.text or .data] are i3, i22 and l. All
of them are backed up by ".globl" symbols.
Mark Mitchell wrote:
>
>
> The MIPS assemblers don't seem to do `.weakext' for data; only for
> functions. For example, on IRIX 6.5:
>
> .data
> .weakext i
> i:
> .word 0
>
> yields, after assembly:
>
> Symbols from test.o:
>
> [Index] Value Size Type Bind Other Shndx Name
>
> [1] | 0| 0|SECT |LOCL |DEFAULT |4 |.data
> [2] | 0| 0|SECT |LOCL |DEFAULT |8 |.debug_info
> [3] | 0| 0|SECT |LOCL |DEFAULT |9 |.debug_abbrev
> [4] | 0| 0|SECT |LOCL |DEFAULT |10 |.debug_frame
> [5] | 0| 0|SECT |LOCL |DEFAULT |11 |.rel.debug_info
>
> Note the lack of `i'.
>
> --
> Mark Mitchell mark@markmitchell.com
> Mark Mitchell Consulting http://www.markmitchell.com
--
+---------------------------------+
|Martin Knoblauch |
|---------------------------------|
|http://www.knobisoft.de |
+---------------------------------+
|e-mail: <knobi@knobisoft.de> |
+---------------------------------+