public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Mark Salter <msalter@redhat.com>
To: Andy.Simpkins@Transcomm.uk.com
Cc: jlarmour@redhat.com, Andy.Simpkins@Transcomm.uk.com,
	ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] forwarded message from Simpkins, Andy
Date: Fri, 17 Aug 2001 10:13:00 -0000	[thread overview]
Message-ID: <200108171713.f7HHDFo02475@deneb.localdomain> (raw)
In-Reply-To: <919A3A7F776FD311AFD600508B44A7F30179584C@ramhqlon.transcomm.uk.com>

>>>>> Simpkins, Andy writes:

> main.o: In function `main':
> main.o(.text+0x10): relocation truncated to fit: R_ARM_PC24
> flash_query(void)
> collect2: ld returned 1 exit status

> what is ld trying to tell me with the truncated error message?  I note that
> this is in the function main NOT flash_query, is this significant?

The linker is being asked to patch an opcode with the difference between
the PC and an address. The R_ARM_PC24 indicates the opcode needs a 24-bit
pc-relative offset. The long_call attribute should force gcc/gas to ask
for a 32-bit absolute address instead of pc-relative.

Here's what the gcc manual says:

`-mlong-calls'
`-mno-long-calls'
     Tells the compiler to perform function calls by first loading the
     address of the function into a register and then performing a
     subroutine call on this register.  This switch is needed if the
     target function will lie outside of the 64 megabyte addressing
     range of the offset based version of subroutine call instruction.

     Even if this switch is enabled, not all function calls will be
     turned into long calls.  The heuristic is that static functions,
     functions which have the `short-call' attribute, functions that
     are inside the scope of a `#pragma no_long_calls' directive and
     functions whose definitions have already been compiled within the
     current compilation unit, will not be turned into long calls.  The
     exception to this rule is that weak function definitions,
     functions with the `long-call' attribute or the `section'
     attribute, and functions that are within the scope of a `#pragma
     long_calls' directive, will always be turned into long calls.

--Mark

  parent reply	other threads:[~2001-08-17 10:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-17  9:24 Simpkins, Andy
2001-08-17  9:31 ` Jonathan Larmour
2001-08-17 10:13 ` Mark Salter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-08-20  8:47 Simpkins, Andy
2001-08-20  1:12 Simpkins, Andy
2001-08-20  6:25 ` Jonathan Larmour
2001-08-17  9:33 Simpkins, Andy
2001-08-17  8:24 Simpkins, Andy
2001-08-17  9:10 ` Jonathan Larmour
2001-08-17  7:42 Simpkins, Andy
2001-08-17  7:46 ` Mark Salter
2001-08-17  7:46 ` David Airlie
2001-08-17  7:31 Simpkins, Andy
2001-08-17  7:36 ` Mark Salter
2001-08-17  7:05 Simpkins, Andy
2001-08-17  7:18 ` Mark Salter
2001-08-17  6:44 Jesper Skov
2001-08-17  6:55 ` Mark Salter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200108171713.f7HHDFo02475@deneb.localdomain \
    --to=msalter@redhat.com \
    --cc=Andy.Simpkins@Transcomm.uk.com \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=jlarmour@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).