This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Relocation type for sbss is R_MIPS_GPREL16 ?
- From: "K. Ahmed Feroz" <feroz at acmet dot com>
- To: <binutils at sources dot redhat dot com>
- Cc: <ranjeeta at acmet dot com>, <sonalsharma at acmet dot com>
- Date: Tue, 4 May 2004 12:40:24 +0530
- Subject: Relocation type for sbss is R_MIPS_GPREL16 ?
Hi,
I have a doubt, please confirm me.
The relocation type produced by the GNU assembler for the LW instruction
depends upon the size of data.
For example, for the two instructions -
#testnode1:
lw $13,sbss_var($0)
#testnode2
lw $13,bss_var($0)
where sbss_var is defined in .sbss section and bss_var is defined in
.bss section,
the relocation types are - R_MIPS_GPREL16 for testnode1
R_MIPS_HI16 followed by R_MIPS_LO16, for testnode2.
I tried generating relocation type as R_MIPS_LO16 for variable in .sbss
section. The disassembled code for the corresponding '.out' file
contained the correct value for the variable.
Why does GNU assembler generate relocation type as R_MIPS_GPREL16 for
data in .sbss section?
Regards
K.Feroz