This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: RFA: PR 68913: Provide weak version of __fread_chk for PR61886 test


On 01/07/2016 06:37 AM, Nick Clifton wrote:
Hi Jeff,

But does the existence of the weak fread_chk change the interactions
inside IPA & LTO in such a way as to compromise the test?

One way to find out would be to check out a compiler before Honza's
change which fixed 61886, verify the test as written fails, verify the
test with your new weak symbol also fails.  Honza didn't fix this until
early December, so you don't have to go terribly far back.

Darn you and your clever brain...  You were right.  My patch prevents
the test from triggering the bug that was fixed by Honza's patch.
I wouldn't say clever, just paranoid around this particular issue.

So I have come up with an alternative, simpler patch - define the
__fread_chk symbol on the linker command line (overriding any definition
that may or may not be present in the target's C library). Since this is
a (final) link time redefinition rather than a compile time one, it does
not interfere with the IPA/LTO code.

This patch works.  I tested it both with an x86_64-pc-linux-gnu
toolchain and an arm-eabi toolchain both before Honza's patch was
committed (both targets fail the test) and with today's gcc sources
(both targets pass the test).

OK to apply ?
As folks noted, I think this is still specific to the linker in use. Does it make sense to just limit this test to specific platforms, perhaps just x86/i686 linux for now. 68913 mentions ppc64-linux fails, it'd be nice to know why since I'd expect that has the _chk symbols.



jeff


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