From: Florian Weimer <fweimer@redhat.com>
To: Siddhesh Poyarekar <siddhesh@sourceware.org>
Cc: libc-alpha@sourceware.org, carlos@redhat.com
Subject: Re: [PATCH] ld.so: Handle read-only dynamic section gracefully [BZ #28340]
Date: Tue, 14 Sep 2021 21:15:41 +0200 [thread overview]
Message-ID: <87wnnjufxe.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210914190919.1728320-1-siddhesh@sourceware.org> (Siddhesh Poyarekar's message of "Wed, 15 Sep 2021 00:39:19 +0530")
* Siddhesh Poyarekar:
> +inline bool __attribute__ ((unused, always_inline))
> +elf_dynamic_info_needs_fixup (struct link_map *l)
> +{
> +#if __ELF_NATIVE_CLASS == 32
> + typedef Elf32_Word d_tag_utype;
> +#elif __ELF_NATIVE_CLASS == 64
> + typedef Elf64_Xword d_tag_utype;
> +#endif
> +
> + if (l->l_addr == 0)
> + return false;
> +
> + for (ElfW(Dyn) *dyn = l->l_ld; dyn->d_tag != DT_NULL; dyn++)
> + switch ((d_tag_utype) dyn->d_tag)
> + {
> + case DT_HASH:
> + case DT_PLTGOT:
> + case DT_STRTAB:
> + case DT_SYMTAB:
> +# if !ELF_MACHINE_NO_RELA
> + case DT_RELA:
> +# endif
> +# if !ELF_MACHINE_NO_REL
> + case DT_REL:
> +# endif
> + case DT_JMPREL:
> + case VERSYMIDX (DT_VERSYM):
> + case ADDRIDX (DT_GNU_HASH):
> + return true;
> + }
> +
> + return false;
> +}
A valid dynamic object must have DT_STRTAB. So I think we can assume
that all objects need fixup, and we do not need this helper function.
See figure 5.10 in
<http://www.sco.com/developers/gabi/latest/ch5.dynamic.html>.
Thanks,
Florian
next prev parent reply other threads:[~2021-09-14 19:15 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 19:09 Siddhesh Poyarekar
2021-09-14 19:15 ` Florian Weimer [this message]
2021-09-15 1:14 ` Siddhesh Poyarekar
2021-09-15 14:35 ` H.J. Lu
2021-09-15 15:42 ` Siddhesh Poyarekar
2021-09-15 16:13 ` H.J. Lu
2021-09-15 16:24 ` Siddhesh Poyarekar
2021-09-15 16:34 ` H.J. Lu
2021-09-16 1:43 ` Siddhesh Poyarekar
2021-09-16 2:23 ` H.J. Lu
2021-09-16 3:46 ` Siddhesh Poyarekar
2021-09-16 4:26 ` H.J. Lu
2021-09-16 4:28 ` Siddhesh Poyarekar
2021-09-16 4:30 ` H.J. Lu
2021-09-16 4:48 ` Florian Weimer
2021-09-16 5:36 ` Siddhesh Poyarekar
2021-09-16 5:46 ` Florian Weimer
2021-09-16 6:04 ` Siddhesh Poyarekar
2021-09-16 14:11 ` Carlos O'Donell
2021-09-16 15:18 ` H.J. Lu
2021-09-16 16:45 ` Siddhesh Poyarekar
2021-09-16 17:38 ` H.J. Lu
2021-09-16 17:58 ` Siddhesh Poyarekar
2021-09-16 22:11 ` H.J. Lu
2021-09-17 2:47 ` Siddhesh Poyarekar
2021-09-17 2:59 ` H.J. Lu
2021-09-17 3:36 ` Siddhesh Poyarekar
2021-09-17 3:42 ` H.J. Lu
2021-09-17 3:44 ` Siddhesh Poyarekar
2021-09-17 3:44 ` Florian Weimer
2021-09-17 3:51 ` Siddhesh Poyarekar
2021-09-16 18:03 ` Florian Weimer
2021-09-16 22:14 ` H.J. Lu
2021-09-17 2:58 ` Siddhesh Poyarekar
2021-09-17 3:46 ` Florian Weimer
2021-09-17 4:00 ` Florian Weimer
2021-09-17 4:12 ` [PATCH] ld.so: Remove DL_RO_DYN_SECTION H.J. Lu
2021-09-17 6:54 ` David Abdurachmanov
2021-09-17 9:01 ` Siddhesh Poyarekar
2021-09-17 15:40 ` H.J. Lu
2021-10-14 12:36 ` [PATCH] ld.so: Handle read-only dynamic section gracefully [BZ #28340] Maciej W. Rozycki
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=87wnnjufxe.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=carlos@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=siddhesh@sourceware.org \
/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).