This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ELF instruction for section and branch.
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: <gagneet at acmet dot com>
- Cc: <gcc at gcc dot gnu dot org>, <gcc-help at gcc dot gnu dot org>
- Date: 20 Dec 2003 10:38:41 -0500
- Subject: Re: ELF instruction for section and branch.
- References: <00b501c3c706$ff7e62f0$9900a8c0@GAGNEET>
"Gagneet Singh" <gagneet@acmet.com> writes:
> So it would appear that we will not be able to generate ELF branch
> across sections in MIPS architecture. But, is it possible for ELF
> architecture as such, or
>
> "official ELF spec does not define a suitable relocation"
>
> the above statement holds true for any architecture with ELF output. If
> I wish to compile and link the example in the x86 architecture with ELF
> format as output, how will I do that and specially is that possible??
Any statement about whether a suitable relocation is available in ELF
is specific to a particular architecture.
You should be able to do cross-section jumps using i386 ELF. The i386
branch instructions are simple 32-bit relocations, which are available
in i386 ELF.
> Also, does GCC define sections in the assembly file as '.section .text1'
> or is this example specific to an architecture??
It's specific to a particular target, though that particular form is
quite common. When using gas, see:
http://sources.redhat.com/binutils/docs-2.12/as.info/Section.html#Section
Ian