From: Matthias Klose <doko@ubuntu.com>
To: Renlin Li <renlin.li@foss.arm.com>,
"binutils@sourceware.org" <binutils@sourceware.org>,
Nicholas Clifton <nickc@redhat.com>,
Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: [BFD][AARCH64]Disallow R_AARCH64_ABS32(LP64) & R_AARCH64_ABS16 in const section of shared object
Date: Fri, 02 Feb 2018 16:45:00 -0000 [thread overview]
Message-ID: <4357965a-e257-5be0-e720-95441ad1ddbc@ubuntu.com> (raw)
In-Reply-To: <59E72FAB.6000804@foss.arm.com>
This seems to break kernel builds, and linking systemd against gnu-efi
libraries. Now reported in PR22764.
Matthias
On 18.10.2017 12:40, Renlin Li wrote:
> Hi all,
>
> R_AARCH64_ABS64, R_AARCH64_ABS32 and R_AARCH64_ABS16 are data relocations
> supported in AArch64 elf ABI.
>
> R_AARCH64_ABS64 under LP64 is allowed in shared object and a dynamic relocation
> entry
> will be generated. This allows the dynamic linker to do further symbol resolution.
>
> R_AARCH64_ABS32 likewise is allowed in shared object, however under ILP32 abi.
>
> The original behavior for R_AARCH64_ABS32 under LP64 is that, it's allowed
> in shared object and silently resolved at static linking time.
> No dynamic relocation entry is generate for it.
>
> R_AARCH64_ABS16 is allowed in shared object under both L64 and ILP32.
> It's resolved at static linking time as well.
>
> Under LP64, the address should be 64-bit. R_AARCH64_ABS32 relocation indicates
> an address that is only sized 32 bits which is not correct in LP64 shared object.
> It's useful to error out.
>
> I have checked glibc dynamic linker code, R_AARCH64_ABS16 is not supported at
> all. So
> R_AARCH64_ABS16 should be reject in shared object completely.
>
>
> In this patch, R_AARCH64_ABS32 is rejected under LP64 in read-only section of
> shared object.
> R_AARCH64_ABS16 is rejected in constant section of shared object in both ABI.
>
> This will sometimes provide useful information for buggy code.
>
> By the way, glibc aarch64 elf_machine_load_address is using R_AARCH64_ABS32 to
> hold an address even in LP64. I had a discussion here sometime ago. The change
> here will break the glibc build. This patch will not be committed until glibc
> has been fixed.
> https://sourceware.org/ml/libc-alpha/2017-10/msg00816.html
>
> testcases are also added. Binutils regression checked OK.
> Linux kernel linked OK with new binutils. OK for trunk?
>
>
> Regards,
> Renlin Li
>
>
> ld/ChangeLog:
>
> 2017-10-18 Renlin Li <renlin.li@arm.com>
>
> Â Â Â Â * testsuite/ld-aarch64/aarch64-elf.exp: Run new test cases.
> Â Â Â Â * testsuite/ld-aarch64/emit-relocs-258-dyn-bad.d: New.
> Â Â Â Â * testsuite/ld-aarch64/emit-relocs-258.s: New.
> Â Â Â Â * testsuite/ld-aarch64/emit-relocs-259-dyn-bad.d: New.
> Â Â Â Â * testsuite/ld-aarch64/emit-relocs-259.s: New.
> Â Â Â Â * testsuite/ld-aarch64/gc-relocs-257.s: Put R_AARCH64_ABS32,
> Â Â Â Â R_AARCH64_ABS16 data into data section.
>
> bfd/ChangeLog:
>
> 2017-10-18 Renlin Li <renlin.li@arm.com>
>
> Â Â Â Â * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Disallow
> Â Â Â Â BFD_RELOC_AARCH64_16 in shared object const section. Disallow
> Â Â Â Â BFD_RELOC_AARCH64_32 in shared object const section under LP64.
>
>
>
next prev parent reply other threads:[~2018-02-02 16:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-18 10:40 Renlin Li
2017-10-20 14:28 ` Renlin Li
2017-12-06 11:46 ` Renlin Li
2017-12-06 12:36 ` Nick Clifton
2018-02-02 16:45 ` Matthias Klose [this message]
2018-02-02 17:31 ` Renlin Li
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=4357965a-e257-5be0-e720-95441ad1ddbc@ubuntu.com \
--to=doko@ubuntu.com \
--cc=Ramana.Radhakrishnan@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=binutils@sourceware.org \
--cc=nickc@redhat.com \
--cc=renlin.li@foss.arm.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).