This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Imported Symbol Attributes
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: GroundVehicle2 at aol dot com
- Cc: binutils at sources dot redhat dot com
- Date: 09 Feb 2004 18:10:03 -0500
- Subject: Re: Imported Symbol Attributes
- References: <624B52CA.61E99923.3FA80DE9@aol.com>
GroundVehicle2@aol.com writes:
> .extern This_Symbol
> .section This_Section
> nop
> .dc.l .-This_Symbol
> .end
>
> Question:
>
> If the symbol "This_Symbol" is defined in another file in the same section "This_Section" why does the assembler not
> understand what section "This_Symbol" belongs to.
The assembler only sees one file at a time. How could the assembler
possibly know what section This_Symbol is in?
The above code won't work in most object file formats because there is
no way to represent the required relocation. Most object file formats
do not have a relocation for a negated symbol value.
On the other hand,
.dc.l This_Symbol - .
will generally work, since that is a PC relative relocation.
Ian