This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Gold: Do not emit locals from discard .eh_frame sections.
- From: Ian Lance Taylor <iant at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 05 Jun 2009 08:31:09 -0700
- Subject: Re: [PATCH] Gold: Do not emit locals from discard .eh_frame sections.
- References: <498552560906041745x378ac510jeb8886f69562d7a6@mail.gmail.com>
"Doug Kwan (éæå)" <dougkwan@google.com> writes:
> 2009-06-04 Doug Kwan <dougkwan@google.com>
>
> * object.cc (Sized_relobj::Sized_relobj): Initialize
> discarded_eh_frame_shndx_ to -1U.
> (Sized_relobj::do_layout): Record index of a discard .eh_frame
> section.
> (Sized_relobj::do_count_local_symbols): Skip local symbols in
> a discarded .eh_frame section.
> (Sized_relobj::do_finalize_local_symbols): Ditto.
> * object.h (class Sized_relobj): Declare new member
> discarded_eh_frame_shndx_.
> * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
> (local_labels_test_SOURCE, local_labels_test_LDFLAGS): Define new.
> (local_labels_test.o): New rule.
> * testsuite/Makefile.in: Regenerate.
> * testsuite/local_labels_test.cc: New file.
> + // There can be at most one .eh_frame section per object.
> + gold_assert(this->discarded_eh_frame_shndx_ == -1U);
> + this->discarded_eh_frame_shndx_ = i;
> + out_section_offsets[i] = invalid_address;
Reading the comment literally makes the loop seem unnecessary. Change
it to say "An object can contain at most one section holding exception
frame information."
> + // If this object has a GNU sytle .eh_frame section that is discarded in
> + // output, record the index here. Otherwise it is -1U.
s/sytle/style/
> +check_PROGRAMS += local_labels_test
> +local_labels_test_SOURCES = local_labels_test.cc
> +local_labels_test_LDFLAGS = -Bgcctestdir/
> +local_labels_test.o: local_labels_test.cc
> + $(CXXCOMPILE) -g -c -Wa,--keep-locals -o $@ $<
Use -L here instead of --keep-locals. -L is supported by many
assemblers, --keep-locals is only supported by gas. We may need to use
a configure test for this, but let's see if we can get away with -L.
Instead of introducing a new nearly-empty .cc file, just have this test
compile basic_test.cc with the -L option.
Ian