[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/418] New: ld builds shared library incorrectly for some eh_frame
From: |
mendell at ca dot ibm dot com |
Subject: |
[Bug ld/418] New: ld builds shared library incorrectly for some eh_frame encodings |
Date: |
30 Sep 2004 13:29:28 -0000 |
Hardware Environment:
cpu : POWER4+ (gq)
clock : 1453MHz
revision: 2.1
Firmware Environment:
Software Environment:
Linux version 2.4.21-9.0.1.EL (address@hidden) (gcc version
3.2.3 20030502 (Red Hat Linux 3.2.3-26)) #1 SMP Mon Feb 9 22:10:20 EST
2004
Steps to Reproduce:
1. cc -m64 -shared t.s
2. objdump -s a.out | less +/eh_frame
Actual Results:
Contents of section .eh_frame:
12660 0000001c 00000000 017a504c 00047841 .........zPL..xA
12670 0a000000 00000000 0000130c 01000000 ................
12680 0000003c 00000024 00000000 00002250 ...<...$......"P
12690 00000000 0000013c 04effed9 d7429f01 .......<.....B..
Expected Results:
Contents of section .eh_frame:
12660 0000001c 00000000 017a504c 00047841 .........zPL..xA
12670 0a000000 00000000 0000030c 01000000 ................ <<< 03, not 13
12680 0000003c 00000024 00000000 00002250 ...<...$......"P
12690 00000000 0000013c 04effed9 d7429f01 .......<.....B..
Additional Information:
The xlC C++ compiler generates eh_frame tables that use an LSDA encoding of
DW_EH_PE_udata4 (value 0x03). When linked to make a shared library, the
linker rewrites the encoding to 0x13 (DW_EH_PE_udata4 | DW_EH_PE_pcrel).
Unfortunately, this doesn't return the same information when
_Unwind_GetLanguageSpecificData is invoked.
The problem code is in bfd/elf-eh-frame.c:
if (info->shared
&& (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr)
cie.make_lsda_relative = 1;
The problem is that the encoding is 0x3, and DW_EH_PE_absptr == 0.
Unfortunately, the mask with 0xf0 makes 0x3 LOOK LIKE DW_EH_PE_absptr.
This causes cie.make_lsda_relative to be set to 1, when it shouldn't.
This affects all distributions, not just RedHat. It is a problem for DB/2
using xlC to improve performance on Linux/PPC.
--
Summary: ld builds shared library incorrectly for some eh_frame
encodings
Product: binutils
Version: 2.15
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: mendell at ca dot ibm dot com
CC: bug-binutils at gnu dot org
http://sources.redhat.com/bugzilla/show_bug.cgi?id=418
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/418] New: ld builds shared library incorrectly for some eh_frame encodings,
mendell at ca dot ibm dot com <=