/* BFD support for handling relocation entries.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by Cygnus Support.
return flag;
}
-/* Clear a given location using a given howto, by applying a relocation value
- of zero and discarding any in-place addend. This is used for fixed-up
+/* Clear a given location using a given howto, by applying a fixed relocation
+ value and discarding any in-place addend. This is used for fixed-up
relocations against discarded symbols, to make ignorable debug or unwind
information more obvious. */
void
_bfd_clear_contents (reloc_howto_type *howto,
bfd *input_bfd,
+ asection *input_section,
bfd_byte *location)
{
int size;
/* Zero out the unwanted bits of X. */
x &= ~howto->dst_mask;
+ /* For a range list, use 1 instead of 0 as placeholder. 0
+ would terminate the list, hiding any later entries. */
+ if (strcmp (bfd_get_section_name (input_bfd, input_section),
+ ".debug_ranges") == 0
+ && (howto->dst_mask & 1) != 0)
+ x |= 1;
+
/* Put the relocated value back in the object file. */
switch (size)
{
BFD_RELOC_ARM_TLS_IE32
ENUMX
BFD_RELOC_ARM_TLS_LE32
+ENUMX
+ BFD_RELOC_ARM_TLS_GOTDESC
+ENUMX
+ BFD_RELOC_ARM_TLS_CALL
+ENUMX
+ BFD_RELOC_ARM_THM_TLS_CALL
+ENUMX
+ BFD_RELOC_ARM_TLS_DESCSEQ
+ENUMX
+ BFD_RELOC_ARM_THM_TLS_DESCSEQ
+ENUMX
+ BFD_RELOC_ARM_TLS_DESC
ENUMDOC
ARM thread-local storage relocations.
ENUMDOC
Annotation of BX instructions.
+ENUM
+ BFD_RELOC_ARM_IRELATIVE
+ENUMDOC
+ ARM support for STT_GNU_IFUNC.
+
ENUM
BFD_RELOC_ARM_IMMEDIATE
ENUMX
BFD_RELOC_ARM_SHIFT_IMM
ENUMX
BFD_RELOC_ARM_SMC
+ENUMX
+ BFD_RELOC_ARM_HVC
ENUMX
BFD_RELOC_ARM_SWI
ENUMX
BFD_RELOC_C6000_PREL31
ENUMX
BFD_RELOC_C6000_COPY
+ENUMX
+ BFD_RELOC_C6000_JUMP_SLOT
+ENUMX
+ BFD_RELOC_C6000_EHTYPE
+ENUMX
+ BFD_RELOC_C6000_PCR_H16
+ENUMX
+ BFD_RELOC_C6000_PCR_L16
ENUMX
BFD_RELOC_C6000_ALIGN
ENUMX
BFD_RELOC_RX_SYM
ENUMX
BFD_RELOC_RX_OP_SUBTRACT
+ENUMX
+ BFD_RELOC_RX_OP_NEG
ENUMX
BFD_RELOC_RX_ABS8
ENUMX
BFD_RELOC_RX_ABS16
+ENUMX
+ BFD_RELOC_RX_ABS16_REV
ENUMX
BFD_RELOC_RX_ABS32
+ENUMX
+ BFD_RELOC_RX_ABS32_REV
ENUMX
BFD_RELOC_RX_ABS16U
ENUMX
long reloc_size;
arelent **reloc_vector;
long reloc_count;
- bfd_size_type sz;
reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
if (reloc_size < 0)
return NULL;
/* Read in the section. */
- sz = input_section->rawsize ? input_section->rawsize : input_section->size;
- if (!bfd_get_section_contents (input_bfd, input_section, data, 0, sz))
+ if (!bfd_get_full_section_contents (input_bfd, input_section, &data))
return NULL;
if (reloc_size == 0)
"unused", FALSE, 0, 0, FALSE);
p = data + (*parent)->address * bfd_octets_per_byte (input_bfd);
- _bfd_clear_contents ((*parent)->howto, input_bfd, p);
+ _bfd_clear_contents ((*parent)->howto, input_bfd, input_section,
+ p);
(*parent)->sym_ptr_ptr = bfd_abs_section.symbol_ptr_ptr;
(*parent)->addend = 0;
(*parent)->howto = &none_howto;