ARM long branch stub fix

Christophe LYON christophe.lyon@st.com
Fri Jun 27 14:09:00 GMT 2008


Hello,

Here is a fix (obvious?) for a bug I discovered under Linux/ARM target 
environment. The check for PLT entry would crash when handling a local 
symbol.

If this is OK, can someone commit it for me?
Thanks

Christophe.

2008-06-26  Christophe Lyon  <christophe.lyon@st.com>

	bfd/
	* elf32-arm.c (arm_type_of_stub): Don't crash on local symbol in
	presence of a PLT.

Index: bfd/elf32-arm.c
===================================================================
--- bfd/elf32-arm.c     (revision 793)
+++ bfd/elf32-arm.c     (working copy)
@@ -2735,7 +2735,7 @@ arm_type_of_stub (struct bfd_link_info *

    /* If the call will go through a PLT entry then we do not need
       glue.  */
-  if (globals->splt != NULL && hash->root.plt.offset != (bfd_vma) -1)
+  if (globals->splt != NULL && hash != NULL && hash->root.plt.offset != 
(bfd_vma) -1)
      return stub_type;

    if (r_type == R_ARM_THM_CALL) {



More information about the Binutils mailing list