[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libunwind] x86 dwarf unwinding requires -fpic compile for shared li
From: |
David Mosberger |
Subject: |
Re: [libunwind] x86 dwarf unwinding requires -fpic compile for shared libs ? |
Date: |
Thu, 15 Jul 2004 10:31:07 -0700 |
>>>>> On Thu, 15 Jul 2004 12:53:37 +0200, David Simms <address@hidden> said:
David.S> Is this really necessary to use -fpic ? From my
David.S> understanding it's possible to link shared without
David.S> compiling PIC on x86, which is desirable considering the
David.S> performance implications. I.E. I wish to avoid it. Does
David.S> anyone know if it's possible to generate .eh_frame_hdr
David.S> without -fpic ?
Hmm, on a Debian/testing machine with gcc v3.3.4, just using
-funwind-tables seems to do the trick:
$ cat t.c
int main (int argc, char **argv) {
printf("hello\n");
}
$ gcc -funwind-tables t.c
$ readelf -l a.out |grep FRAME
GNU_EH_FRAME 0x0004cc 0x080484cc 0x080484cc 0x00014 0x00014 R 0x4
David.S> Are there any plans to include processing of .eh_frame
David.S> section if .eh_frame_hdr fails ? It probably be more
David.S> portable with older gcc/ld versions.
When I wrote the DWARF2 support code originally, I wanted to keep
things simple and start with the "modern" way of doing things. I
wouldn't mind if code was added to support the old way but, on the
other hand, I suspect much of the old code doesn't have unwind-tables
anyhow so perhaps this would give a false sense of security/coverage?
--david