This is an archive of the discontinued LLVM Phabricator instance.

[LLD][ELF] - Improve diagnostic about unrecognized relocations.
ClosedPublic

Authored by grimar on May 22 2019, 1:48 AM.

Details

Summary

This is a minor improvement inspired by https://bugs.llvm.org/show_bug.cgi?id=38303.

A person reported that he observed message complaining about unsupported R_ARM_V4BX:
error: can't create dynamic relocation R_ARM_V4BX against local symbol in readonly segment; recompile object files with -fPIC

But with -z notext he only saw a relocation number, what is not convenient:
error: ../../gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.o:(.text+0x4F0): unrecognized reloc 40

Also, in the error messages we use relocation but not reloc.

With this patch we start to print one of the following messages:
error: file.o: unrecognized relocation Unknown(999)
error: file.o: unrecognized relocation R_X_KNOWN_BY_LLVM_BUT_UNSUPPORTED_BY_LLD_NAME

There is no way to write a test for that I believe.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

grimar created this revision.May 22 2019, 1:48 AM
grimar edited the summary of this revision. (Show Details)May 22 2019, 1:49 AM
grimar removed a reviewer: espindola.
This revision is now accepted and ready to land.May 22 2019, 2:27 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2019, 2:47 AM