This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: MIPS16 text labels
- From: Ian Lance Taylor <iant at google dot com>
- To: "Fu\, Chao-Ying" <fu at mips dot com>
- Cc: <binutils at sourceware dot org>, "Thiemo Seufer" <ths at networkno dot de>, "Richard Sandiford" <rdsandiford at googlemail dot com>
- Date: Sat, 28 Jun 2008 21:02:15 -0700
- Subject: Re: MIPS16 text labels
- References: <94BD67F8AF3ED34FA362C662BA1F12C501007DE6@MTVEXCHANGE.mips.com>
"Fu, Chao-Ying" <fu@mips.com> writes:
> The MIPS16 text labels are stored as odd addresses in "tc-mips.c".
> Does anyone know the reason of storing odd addresses?
It's so that if you do
.word FN
where FN is a MIPS16 symbol, the right thing happens when that value
is loaded into the PC.
Besides the code in the assembler, see _bfd_mips_elf_add_symbol_hook
and _bfd_mips_elf_link_output_symbol_hook in bfd/elfxx-mips.c.
Ian