This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [ARM] Avoid dereferencing null pointers
Hi Christophe,
I'm a bit surprised cmse_scan is run at all in your case. Where you
targeting an M profile core?
Regarding sym_hashes[X] being null, under what conditions can a global
symbol have a null hash?
Best regards,
Thomas
On Tue, 23 Oct 2018 at 23:16, Alan Modra <amodra@gmail.com> wrote:
>
> On Tue, Oct 23, 2018 at 04:21:41PM +0200, Christophe Lyon wrote:
> > Hi,
> >
> > While building an ARM FDPIC toolchain with a compiler generating Thumb
> > code, I face a couple of null pointer dereferences in cmse_scan().
> >
> > When browsing ld-uClibc.so.1, all the external symbols have no info in
> > sym_hashes (sym_hashes[X] == NULL), and when handling libgcc_s.so.1
> > for the 2nd time in the same command, sym_hashes == NULL.
> >
> > I don't know why this doesn't happen with a compiler generating Arm
> > code (ie. why the symbol tables are handled differently), but the
> > attached small patch prevents the linker from crashing.
> >
> > OK?
>
> No, this is just papering over the real problem. You need to find out
> why the sym hashes are not being set up (or are being overwritten).
>
> --
> Alan Modra
> Australia Development Lab, IBM