This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [ARM] Avoid dereferencing null pointers
- From: Alan Modra <amodra at gmail dot com>
- To: Christophe Lyon <christophe dot lyon at linaro dot org>
- Cc: binutils <binutils at sourceware dot org>
- Date: Thu, 21 Nov 2019 08:31:57 +1030
- Subject: Re: [ARM] Avoid dereferencing null pointers
- References: <CAKdteOYqxMCpOrBnH_N8JmJZzLgMwxZx0ywkh_DDPUvub9OPKA@mail.gmail.com> <20181023221621.GA27701@bubble.grove.modra.org> <CAKnkMGs2JmPjLHFv4LA06p5-3KHPSuxNjpQm+pcv5VZu1D7Q6g@mail.gmail.com> <20181024113624.GC1322@bubble.grove.modra.org> <CAKdteOYDyCxKgE5t7siHc-1G+p0uJjoVsom34sa3RMN4vLHMwA@mail.gmail.com> <20191120214903.GS13199@bubble.grove.modra.org>
On Thu, Nov 21, 2019 at 08:19:03AM +1030, Alan Modra wrote:
> Using this should work:
>
> if (!is_arm_elf (input_bfd)
> || elf_sym_hashes (input_bfd) == 0
> || (elf_dyn_lib_class (input_bfd) & DYN_AS_NEEDED) != 0)
> continue;
Actually, that might not be such a good idea. An object without any
global symbols will have sym_hashes NULL too.
--
Alan Modra
Australia Development Lab, IBM