This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ELF instruction for section and branch.


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]