This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[mips] relative FDE relocations without DW_EH_PE_signed
- From: Mingjie Xing <mingjie dot xing at gmail dot com>
- To: binutils at sourceware dot org
- Date: Wed, 13 Oct 2010 11:28:47 +0800
- Subject: [mips] relative FDE relocations without DW_EH_PE_signed
Hello,
I get a test case failed when I run 'make check-ld' on my platform.
The failed test case is ld/testsuite/ld-mips-elf/eh-frame1.s. Here is
the error information.
regexp_diff match failure
regexp "^00000014 00000010 00000018 FDE cie=00000000 pc=00020000..00020010$"
line "00000014 00000010 00000018 FDE cie=00000000 pc=100020000..100020010"
regexp_diff match failure
regexp "^00000028 00000010 0000002c FDE cie=00000000 pc=00020010..00020030$"
line "00000028 00000010 0000002c FDE cie=00000000 pc=100020010..100020030"
regexp_diff match failure
...
FAIL: MIPS eh-frame 1, n32
I find that bfd will try to convert absolute FDE relocations into
relative ones by setting make_relative = 1. See bfd/elf-eh-frame.c
(_bfd_elf_parse_eh_frame):
/* For shared libraries, try to get rid of as many RELATIVE relocs
as possible. */
if (info->shared
&& (get_elf_backend_data (abfd)
->elf_backend_can_make_relative_eh_frame
(abfd, info, sec)))
{
if ((cie->fde_encoding & 0xf0) == DW_EH_PE_absptr)
this_inf->make_relative = 1;
/* If the CIE doesn't already have an 'R' entry, it's fairly
easy to add one, provided that there's no aligned data
after the augmentation string. */
else if (cie->fde_encoding == DW_EH_PE_omit
&& (cie->per_encoding & 0xf0) != DW_EH_PE_aligned)
{
if (*cie->augmentation == 0)
this_inf->add_augmentation_size = 1;
this_inf->u.cie.add_fde_encoding = 1;
this_inf->make_relative = 1;
}
}
When bfd starts to write section in _bfd_elf_write_section_eh_frame,
the addresses will be converted as negative values, for example
0xfffeffe4. But the fde encoding is not DW_EH_PE_signed at this time.
This will cause the address be dumped as an unsigned value, which
looks like pc=100020000.
Is it a bug?
Thanks,
Mingjie