* elf-eh-frame.c (make_pc_relative): New function.
(_bfd_elf_write_section_eh_frame): Use it.
ld/testsuite/
* ld-mips-elf/eh-frame1-n32.d: Expect PC-relative encodings
to include DW_EH_PE_sdata4.
* ld-mips-elf/eh-frame2-n32.d: Likewise.
* ld-mips-elf/eh-frame1-n64.d: Expect PC-relative encodings
to include DW_EH_PE_sdata8.
* ld-mips-elf/eh-frame2-n64.d: Likewise.
+2009-09-21 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * elf-eh-frame.c (make_pc_relative): New function.
+ (_bfd_elf_write_section_eh_frame): Use it.
+
2009-09-21 Alan Modra <amodra@bigpond.net.au>
* elf32-ppc.c (TLS_GET_ADDR_GLINK_SIZE): Define.
return last;
}
+/* Convert absolute encoding ENCODING into PC-relative form.
+ SIZE is the size of a pointer. */
+
+static unsigned char
+make_pc_relative (unsigned char encoding, unsigned int ptr_size)
+{
+ if ((encoding & 0x7f) == DW_EH_PE_absptr)
+ switch (ptr_size)
+ {
+ case 2:
+ encoding |= DW_EH_PE_sdata2;
+ break;
+ case 4:
+ encoding |= DW_EH_PE_sdata4;
+ break;
+ case 8:
+ encoding |= DW_EH_PE_sdata8;
+ break;
+ }
+ return encoding | DW_EH_PE_pcrel;
+}
+
/* Called before calling _bfd_elf_parse_eh_frame on every input bfd's
.eh_frame section. */
{
BFD_ASSERT (action & 1);
*aug++ = 'R';
- *buf++ = DW_EH_PE_pcrel;
+ *buf++ = make_pc_relative (DW_EH_PE_absptr, ptr_size);
action &= ~1;
}
if (action & 2)
{
BFD_ASSERT (*buf == ent->lsda_encoding);
- *buf |= DW_EH_PE_pcrel;
+ *buf = make_pc_relative (*buf, ptr_size);
action &= ~2;
}
buf++;
if (action & 1)
{
BFD_ASSERT (*buf == ent->fde_encoding);
- *buf |= DW_EH_PE_pcrel;
+ *buf = make_pc_relative (*buf, ptr_size);
action &= ~1;
}
buf++;
+2009-09-21 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * ld-mips-elf/eh-frame1-n32.d: Expect PC-relative encodings
+ to include DW_EH_PE_sdata4.
+ * ld-mips-elf/eh-frame2-n32.d: Likewise.
+ * ld-mips-elf/eh-frame1-n64.d: Expect PC-relative encodings
+ to include DW_EH_PE_sdata8.
+ * ld-mips-elf/eh-frame2-n64.d: Likewise.
+
2009-09-21 Alan Modra <amodra@bigpond.net.au>
* ld-powerpc/tlslib.s: Delete dot-symbol entry syms. Add
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10
+ Augmentation data: 1b
DW_CFA_advance_loc: 0 to 00000000
DW_CFA_advance_loc: 0 to 00000000
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10 00 00 00 00 00
+ Augmentation data: 1b 00 00 00 00 00
DW_CFA_advance_loc: 0 to 00000000
DW_CFA_advance_loc: 0 to 00000000
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 00 00 00 00 00 10
+ Augmentation data: 00 00 00 00 00 1b
DW_CFA_advance_loc: 0 to 00000000
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10
+ Augmentation data: 1c
DW_CFA_advance_loc: 0 to 00000000
DW_CFA_advance_loc: 0 to 00000000
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10 00 00 00 00 00 00 00 00 00
+ Augmentation data: 1c 00 00 00 00 00 00 00 00 00
DW_CFA_advance_loc: 0 to 00000000
DW_CFA_advance_loc: 0 to 00000000
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 00 00 00 00 00 00 00 00 00 10
+ Augmentation data: 00 00 00 00 00 00 00 00 00 1c
DW_CFA_advance_loc: 0 to 00000000
DW_CFA_advance_loc: 0 to 00000000
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10
+ Augmentation data: 1b
DW_CFA_nop
DW_CFA_nop
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10 00 00 00 00 00
+ Augmentation data: 1b 00 00 00 00 00
DW_CFA_nop
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 00 00 00 00 00 10
+ Augmentation data: 00 00 00 00 00 1b
DW_CFA_nop
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10
+ Augmentation data: 1c
DW_CFA_nop
DW_CFA_nop
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 10 00 00 00 00 00 00 00 00 00
+ Augmentation data: 1c 00 00 00 00 00 00 00 00 00
DW_CFA_nop
DW_CFA_nop
Code alignment factor: 1
Data alignment factor: 4
Return address column: 31
- Augmentation data: 00 00 00 00 00 00 00 00 00 10
+ Augmentation data: 00 00 00 00 00 00 00 00 00 1c
DW_CFA_nop
DW_CFA_nop