This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Unterminated .eh_frame when using --eh-frame-hdr


Richard Henderson <rth@twiddle.net> writes:
> On Mon, Nov 08, 2004 at 06:51:43AM -0800, Ulrich Drepper wrote:
>> Then fix the linker.  We are not adding support for broken tools,
>> especially not when it affects only one architecture.
>
> The proper fix is to *always* emit the terminal zero, without
> regard to the configury.  Failure to do so means the data is
> not in the correct format.

That's what I thought.  And FWIW, that's exactly what my
patch is supposed to do.  The dwarf2 eh stuff is controlled by
libc_cv_gcc_dwarf2_unwind_info, which has four settings:

  no_registry_needed (the case we're talking about here):
     currently defines no macros

  static:
     currently defines HAVE_DWARF2_UNWIND_INFO
     and HAVE_DWARF2_UNWIND_INFO_STATIC

  yes:
     currently defines HAVE_DWARF2_UNWIND_INFO

  no
     currently defines no macros

So at the moment:

  - soinit.c and sofini.c handle the .eh_frame_hdr and no-.eh_frame
    cases in the same way.

  - HAVE_DWARF2_UNWIND_INFO means that we have a .eh_frame section
    _and_ that we need explicit calls to register it.

What my patch does is:

  - make HAVE_DWARF2_UNWIND_INFO mean "we're using .eh_frame",
    and nothing else.

  - leave the zero terminator guarded by HAVE_DWARF2_UNWIND_INFO,
    meaning that .eh_frame is _always_ zero terminated.

  - introduce a new macro, HAVE_DWARF2_UNWIND_INFO_REGISTRY to
    control whether calls to the registry routines are needed.

The four settings then look like this:

  no_registry_needed:
     defines HAVE_DWARF2_UNWIND_INFO

  static:
     defines HAVE_DWARF2_UNWIND_INFO
     and HAVE_DWARF2_UNWIND_INFO_REGISTRY
     and HAVE_DWARF2_UNWIND_INFO_STATIC

  yes:
     defines HAVE_DWARF2_UNWIND_INFO
     and HAVE_DWARF2_UNWIND_INFO_REGISTRY

  no
     defines no macros

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]