public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Frédéric Rivière" <frederic.riviere@microej.com>
To: Nick Clifton <nickc@redhat.com>
Cc: binutils@sourceware.org
Subject: Re: load of in-place relocation addend in AArch64
Date: Mon, 11 Dec 2023 08:51:59 +0100	[thread overview]
Message-ID: <56093691-58df-4917-99e7-41a47e5e1e5d@microej.com> (raw)
In-Reply-To: <578e6c40-5e6c-448f-bb76-791ad19db444@redhat.com>

Hi Nick,

I understand the reason and I agree with a warning, because in the 
meantime I realized that REL relocations are correctly supported when 
there is no in-place addend.

So we could improve the message as following:

"Warning: REL type relocations are not expected for architecture 
'aarch64' - in-place addends with non-zero values are not supported."

Also I believe it would be perfect if this message could be printed only 
during the relocation process, to avoid impacting the other tools.

I'm not familiar with LD code base but is there any chance to be able to 
retrieve the original relocation kind when we are in the 
"elfNN_aarch64_relocate_section" function ?

(for example by being able to retrieve the original relocation section 
type or the relocation entry size for example)

Best Regards,

--Frédéric

On 12/7/2023 6:16 PM, Nick Clifton wrote:
> Hi Frédéric,
>
>   OK, I have produced a small patch (attached) which adds this warning
>   message to the linker's output:
>
>     $ ld test_AArch64_with_REL.o
>     ld: test_AArch64_with_REL.o: Warning: REL type relocations are not 
> expected for architecture 'aarch64' - support may be incomplete
>
>   This warning does not actually stop the link from completing however.
>   The reason for this is that the code where the relocations are loaded
>   is shared by other tools, which do still work with REL relocations.
>   For example the objdump tool is able to display the relocations without
>   any problems:
>
>     $ objdump -r test_AArch64_with_REL.o
>     BFD: test_AArch64_with_REL.o: Warning: REL type relocations are 
> not expected for architecture 'aarch64' - support may be incomplete
>
>     test_AArch64_with_REL.o:     file format elf64-littleaarch64
>
>     RELOCATION RECORDS FOR 
> [.text.__icetea__virtual__com_is2t_icetea_support_test_BImpl___bar__I]:
>     OFFSET           TYPE              VALUE
>     0000000000000008 R_AARCH64_ABS32 
> com_is2t_icetea_support_test_AImpl___bar
>     [...]
>
>   This strikes me as a compromise solution at best, but it is better
>   than the current situation nonetheless.
>
>   What do you think ?
>
> Cheers
>   Nick
>
>
>
-- 
MicroEJ <http://www.microej.com> 	

Frédéric RIVIERE
/CTO Office Member & VP Product/

11 rue du Chemin Rouge - Bat. D 44373 Nantes Cedex 3, France 
https://www.linkedin.com/in/fredericriviere/

Twitter <https://twitter.com/microej> LinkedIn 
<https://www.linkedin.com/company/microej> Youtube 
<https://www.youtube.com/@MicroEJ_News>

event <https://www.microej.com/event/>

This email (and all attachments) may contain information that is 
proprietary privileged, and/or confidential. If you received this e-mail 
in error or if it was improperly forwarded to you, the information 
contained in the e-mail should, at all times, remain confidential. 
Please notify the sender immediately by e-mail, and delete or destroy 
the original and any copies. Any unauthorized use, disclosure, 
reproduction, retention or distribution by any person other than the 
intended recipient is strictly prohibited.


  reply	other threads:[~2023-12-11  7:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06  8:08 Frédéric Rivière
2023-12-06 11:14 ` Nick Clifton
2023-12-06 15:02   ` Frédéric Rivière
2023-12-06 15:31     ` Nick Clifton
2023-12-06 16:56       ` Frédéric Rivière
2023-12-07 17:16         ` Nick Clifton
2023-12-11  7:51           ` Frédéric Rivière [this message]
2024-03-28  7:10             ` Fangrui Song

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=56093691-58df-4917-99e7-41a47e5e1e5d@microej.com \
    --to=frederic.riviere@microej.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@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).