* PING: [PATCH] [BZ #18410]: Incorrect handling of missing DT_PLTRELSZ
@ 2015-05-22 20:29 H.J. Lu
2015-05-22 21:03 ` Roland McGrath
0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2015-05-22 20:29 UTC (permalink / raw)
To: GNU C Library
On Fri, May 15, 2015 at 12:25 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> A shared object doesn't need PLT if there are no PLT relocations. It
> shouldn't be an error if DT_PLTRELSZ is missing.
>
> OK for master?
>
>
> H.J.
> --
> [BZ #18410]
> * elf/dl-reloc.c (_dl_relocate_object): Don't issue an error
> for missing DT_PLTRELSZ.
> ---
> elf/dl-reloc.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
> index 0872636..068ea65 100644
> --- a/elf/dl-reloc.c
> +++ b/elf/dl-reloc.c
> @@ -258,21 +258,13 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
> ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
>
> #ifndef PROF
> - if (__glibc_unlikely (consider_profiling))
> + if (__glibc_unlikely (consider_profiling
> + && l->l_info[DT_PLTRELSZ] != NULL))
> {
> /* Allocate the array which will contain the already found
> relocations. If the shared object lacks a PLT (for example
> if it only contains lead function) the l_info[DT_PLTRELSZ]
> will be NULL. */
> - if (l->l_info[DT_PLTRELSZ] == NULL)
> - {
> - errstring = N_("%s: no PLTREL found in object %s\n");
> - fatal:
> - _dl_fatal_printf (errstring,
> - RTLD_PROGNAME,
> - l->l_name);
> - }
> -
> size_t sizeofrel = l->l_info[DT_PLTREL]->d_un.d_val == DT_RELA
> ? sizeof (ElfW(Rela))
> : sizeof (ElfW(Rel));
> @@ -283,7 +275,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
> {
> errstring = N_("\
> %s: out of memory to store relocation results for %s\n");
> - goto fatal;
> + _dl_fatal_printf (errstring, RTLD_PROGNAME, l->l_name);
> }
> }
> #endif
> --
> 1.9.3
>
PING.
--
H.J.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PING: [PATCH] [BZ #18410]: Incorrect handling of missing DT_PLTRELSZ
2015-05-22 20:29 PING: [PATCH] [BZ #18410]: Incorrect handling of missing DT_PLTRELSZ H.J. Lu
@ 2015-05-22 21:03 ` Roland McGrath
0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2015-05-22 21:03 UTC (permalink / raw)
To: H.J. Lu; +Cc: GNU C Library
> > - if (__glibc_unlikely (consider_profiling))
> > + if (__glibc_unlikely (consider_profiling
> > + && l->l_info[DT_PLTRELSZ] != NULL))
Put __glibc_unlikely just around consider_profiling.
OK with that change.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-22 18:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-22 20:29 PING: [PATCH] [BZ #18410]: Incorrect handling of missing DT_PLTRELSZ H.J. Lu
2015-05-22 21:03 ` Roland McGrath
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).