This is the mail archive of the mailing list for the binutils 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: ld corrupting .cfi_label uses

>>> On 05.03.17 at 05:21, <> wrote:
> On Fri, Mar 03, 2017 at 03:24:13AM -0700, Jan Beulich wrote:
>> >>> On 03.03.17 at 10:43, <> wrote:
>> > On Fri, Mar 03, 2017 at 12:28:46AM -0700, Jan Beulich wrote:
>> >> >>> On 02.03.17 at 22:34, <> wrote:
>> >> > So I have some further patches for powerpc64, and am modifying
>> >> > elf-eh-frame.c to align CIEs and FDEs ideally.  Current patch looks at
>> >> > the FDE encoding to choose 4 or 8 byte alignment in order to make FDE
>> >> > range start and size naturally aligned.
>> >> 
>> >> That was one of my thoughts too, but would seem to collide with
>> >> the dwarf2_format_64bit case: That emits 32 bits of all ones
>> >> followed by two 64-bit quantities. DWARF2_FDE_RELOC_SIZE
>> >> being larger than 4 would the still mean misaligned fields (as much
>> >> as the two mentioned 64-bit ones already appear to be).
>> > 
>> > gas doesn't generate a 64-bit eh_frame, and elf-eh-frame.c doesn't
>> > support 64-bit eh_frame.  So not a problem.
>> Oh, so you do what you said above only in the .eh_frame case,
> Yes.
>> but not in the Dwarf one? (I've run the testsuite on ppc64 over
>> your original patch, without there being any issue. Nevertheless
>> I would of course appreciate to get to see the further
>> adjustments you've made. Or perhaps you mean to commit them
>> soon anyway?)
>> As to all of the changes so far (including reducing the alignment
>> on x86-64) helping - no, sadly not. There are still some CIEs and/or
>> FDEs folded during final link, so labels still point to the wrong place.
>> It's just not as far off anymore.
> BTW, --traditional-format should turn off eh_frame editing.

Ah, thanks for the hint. It looks like the main other effect of passing
the flag would be .stabs related, which is of no interest for the Linux
kernel, so it may well be suitable as a temporary workaround - I'll
give this a try.

> Here's what I'm about to commit.

Thanks, for doing this, even if it is only part of what's needed to
fully cope with .cfi_label. I'm getting the impression though that my
change to force .eh_frame alignment to just 4 on x86-64 will have
the same (or actually marginally wider) effect than this larger (but
of course architecture independent) change.


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