This is an archive of the discontinued LLVM Phabricator instance.

[mips][freebsd] Explicitly select PC-relative Personality and LSDA encodings.
AbandonedPublic

Authored by dsanders on Nov 16 2015, 4:11 AM.

Details

Reviewers
seanbruno
Summary

The Mips port of FreeBSD is currently using an old linker (GNU ld 2.17.50
[FreeBSD] 2007-07-03) which seems to be unable to fully support read-only
.eh_frame sections. However, there exists a patch to fix this (see PR25176)
which adds the missing R_MIPS_PC32 relocation and also seems to fix some
.eh_frame-related crashes.

This patch makes clang use appropriate encodings to support read-only .eh_frame
sections with this patched linker.

Diff Detail

Event Timeline

dsanders updated this revision to Diff 40274.Nov 16 2015, 4:11 AM
dsanders retitled this revision from to [mips][freebsd] Explicitly select PC-relative Personality and LSDA encodings..
dsanders updated this object.
dsanders added subscribers: emaste, seanbruno, llvm-commits.
emaste added inline comments.Nov 16 2015, 7:58 AM
lib/MC/MCObjectFileInfo.cpp
374

Perhaps we should be explicit about this applying to bfd ld 2.17.50. Someone could consider reverting this in a few years once we have a contemporary LLD as the system linker.

dsanders added inline comments.Nov 16 2015, 8:10 AM
lib/MC/MCObjectFileInfo.cpp
374

Given the choice I'd prefer to change the Linux encodings to match FreeBSD at some point in the future. MIPS Linux seems to be the only target that has to ask for absolute encodings in order to get pc-relative encodings.

Given the choice I'd prefer to change the Linux encodings to match FreeBSD at some point in the future. MIPS Linux seems to be the only target that has to ask for absolute encodings in order to get pc-relative encodings.

Can we do it now? I.E, always ask for pc relative?

Cheers,
Rafael

ping. Is it ok to make FreeBSD ask for the right thing and leave the Linux workaround in until our tools accept the right thing?

Anything further I can do here?

Anything further I can do here?

I think the patch is good but I need someone else to review it and say 'LGTM' before I can commit it.

So, should FreeBSD run this as a local patch or should we commit this into LLVM as a workaround for our old and crufty LD?

It is unclear. Without knowing what is an actual gas/ld bug and what
is a reasonable limitation. Why is gas on linux rejecting indirect
pcrel? Is it at least acknowledge as a bug or are they aware of some
reason to reject it that we are not?

Cheers,
Rafael

Why is gas on linux rejecting indirect pcrel? Is it at least acknowledge as a bug or are they aware of some
reason to reject it that we are not?

I don't know the reason but it's been like it a long time.

I don't understand why the behaviour of Linux should prevent us from fixing FreeBSD. Is there something I'm missing?

seanbruno requested changes to this revision.Mar 8 2017, 12:11 PM

The testcase needs to be refreshed against -head. Otherwise, this is good.

This revision now requires changes to proceed.Mar 8 2017, 12:11 PM
dsanders abandoned this revision.Jul 18 2019, 7:06 PM
emaste added a subscriber: brooks.Jul 23 2019, 1:47 PM

@brooks @arichardson is this something we want to revisit?

@brooks @arichardson is this something we want to revisit?

nvm, was committed as rL277732

And moved to CodeGen in rL339397