summaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2022-07-25 09:25:49 +0930
committerAlan Modra <amodra@gmail.com>2022-07-25 09:49:41 +0930
commit5d471bd907be60e9858b22cdf4fd10ddc0f6ee1a (patch)
treecfe0f5a7f41e3ac61ddf48e0dc2edb23382c7e54 /ld/ldlang.c
parent5d8af25542611afd6f773a45b3c89b2169445014 (diff)
downloadbinutils-gdb-5d471bd907be60e9858b22cdf4fd10ddc0f6ee1a.tar.gz
Re: PowerPC64 .branch_lt address
On seeing PR29369 my suspicion was naturally on a recent powerpc64 change, commit 0ab80031430e. Without a reproducer, I spent time wondering what could have gone wrong, and while I doubt this patch would have fixed the PR, there are some improvements that can be made to cater for user silliness. I also noticed that when -z relro -z now sections are created out of order, with .got before .plt in the section headers but .got is laid out at a higher address. That's due to the address expression for .branch_lt referencing SIZEOF(.got) and so calling init_os (which creates a bfd section) for .got before the .plt section is created. Fix that by ignoring SIZEOF in exp_init_os. Unlike ADDR and LOADADDR which need to reference section vma and lma respectively, SIZEOF can and does cope with a missing bfd section by returning zero for its size, which of course is correct. PR 29369 * ldlang.c (exp_init_os): Don't create a bfd section for SIZEOF. * emulparams/elf64ppc.sh (OTHER_RELRO_SECTIONS_2): Revise .branch_lt address to take into account possible user sections with alignment larger than 8 bytes.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index e640380e901..f12c09633a7 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2458,7 +2458,6 @@ exp_init_os (etree_type *exp)
{
case ADDR:
case LOADADDR:
- case SIZEOF:
{
lang_output_section_statement_type *os;