View | Details | Raw Unified | Return to bug 15904 | Differences between
and this patch

Collapse All | Expand All

(-)binutils-2.23.52.20130727-orig/bfd/elfnn-ia64.c (+3 lines)
Lines 586-619 elfNN_ia64_relax_section (bfd *abfd, ase Link Here
586
		  ia64_elf_relax_brl (contents, roff);
586
		  ia64_elf_relax_brl (contents, roff);
587
587
588
		  irel->r_info
588
		  irel->r_info
589
		    = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
589
		    = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
590
				    R_IA64_PCREL21B);
590
				    R_IA64_PCREL21B);
591
591
592
		  /* If the original relocation offset points to slot
592
		  /* If the original relocation offset points to slot
593
		     1, change it to slot 2.  */
593
		     1, change it to slot 2.  */
594
		  if ((irel->r_offset & 3) == 1)
594
		  if ((irel->r_offset & 3) == 1)
595
		    irel->r_offset += 1;
595
		    irel->r_offset += 1;
596
597
		  changed_relocs = TRUE;
596
		}
598
		}
597
599
598
	      continue;
600
	      continue;
599
	    }
601
	    }
600
	  else if (r_type == R_IA64_PCREL60B)
602
	  else if (r_type == R_IA64_PCREL60B)
601
	    continue;
603
	    continue;
602
	  else if (ia64_elf_relax_br (contents, roff))
604
	  else if (ia64_elf_relax_br (contents, roff))
603
	    {
605
	    {
604
	      irel->r_info
606
	      irel->r_info
605
		= ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
607
		= ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info),
606
				R_IA64_PCREL60B);
608
				R_IA64_PCREL60B);
607
609
608
	      /* Make the relocation offset point to slot 1.  */
610
	      /* Make the relocation offset point to slot 1.  */
609
	      irel->r_offset = (irel->r_offset & ~((bfd_vma) 0x3)) + 1;
611
	      irel->r_offset = (irel->r_offset & ~((bfd_vma) 0x3)) + 1;
612
	      changed_relocs = TRUE;
610
	      continue;
613
	      continue;
611
	    }
614
	    }
612
615
613
	  /* We can't put a trampoline in a .init/.fini section. Issue
616
	  /* We can't put a trampoline in a .init/.fini section. Issue
614
	     an error.  */
617
	     an error.  */
615
	  if (strcmp (sec->output_section->name, ".init") == 0
618
	  if (strcmp (sec->output_section->name, ".init") == 0
616
	      || strcmp (sec->output_section->name, ".fini") == 0)
619
	      || strcmp (sec->output_section->name, ".fini") == 0)
617
	    {
620
	    {
618
	      (*_bfd_error_handler)
621
	      (*_bfd_error_handler)
619
		(_("%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."),
622
		(_("%B: Can't relax br at 0x%lx in section `%A'. Please use brl or indirect branch."),

Return to bug 15904