summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/bfd/elf-eh-frame.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-02-22 04:18:42 +0000
committerobrien <obrien@FreeBSD.org>2002-02-22 04:18:42 +0000
commit670387a18a22cf299c750186efe8ca24cebb7e05 (patch)
tree70c0d6a941b83c97839ec1237622c20ea8beb870 /contrib/binutils/bfd/elf-eh-frame.c
parentfc89183cdc6be5afa8deb7250fd15a20832ab528 (diff)
downloadFreeBSD-src-670387a18a22cf299c750186efe8ca24cebb7e05.zip
FreeBSD-src-670387a18a22cf299c750186efe8ca24cebb7e05.tar.gz
Import of Binutils from the FSF 2.12 branch (pre-.0 release).
These bits are taken from the FSF anoncvs repo on 21-Feburary-2002 20:15 PST.
Diffstat (limited to 'contrib/binutils/bfd/elf-eh-frame.c')
-rw-r--r--contrib/binutils/bfd/elf-eh-frame.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/contrib/binutils/bfd/elf-eh-frame.c b/contrib/binutils/bfd/elf-eh-frame.c
index b479c00..20cbfb2 100644
--- a/contrib/binutils/bfd/elf-eh-frame.c
+++ b/contrib/binutils/bfd/elf-eh-frame.c
@@ -586,16 +586,12 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
}
/* For shared libraries, try to get rid of as many RELATIVE relocs
- as possible.
- FIXME: For this to work, ELF backends need to perform the
- relocation if omitting dynamic relocs, not skip it. */
- if (0
- && info->shared
+ as possible. */
+ if (info->shared
&& (cie.fde_encoding & 0xf0) == DW_EH_PE_absptr)
cie.make_relative = 1;
- if (0
- && info->shared
+ if (info->shared
&& (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr)
cie.make_lsda_relative = 1;
@@ -636,6 +632,16 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec,
}
else
{
+ if (info->shared
+ && (cie.fde_encoding & 0xf0) == DW_EH_PE_absptr
+ && cie.make_relative == 0)
+ {
+ /* If shared library uses absolute pointers
+ which we cannot turn into PC relative,
+ don't create the binary search table,
+ since it is affected by runtime relocations. */
+ hdr_info->table = false;
+ }
cie_usage_count++;
hdr_info->fde_count++;
}
@@ -856,7 +862,7 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset)
if (sec_info->entry[mid].make_relative
&& ! sec_info->entry[mid].cie
&& offset == sec_info->entry[mid].offset + 8)
- return (bfd_vma) -1;
+ return (bfd_vma) -2;
/* If converting LSDA pointers to DW_EH_PE_pcrel, there will be no need
for run-time relocation against LSDA field. */
@@ -865,7 +871,7 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset)
&& (offset
== (sec_info->entry[mid].offset + 8
+ sec_info->entry[mid].lsda_offset)))
- return (bfd_vma) -1;
+ return (bfd_vma) -2;
return (offset + sec_info->entry[mid].new_offset
- sec_info->entry[mid].offset);
OpenPOWER on IntegriCloud