[PATCH] D35724: [ELF] - Fix missing relocation when linking executable with --unresolved-symbols=ignore-all

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 06:24:19 PDT 2017


grimar created this revision.
Herald added a subscriber: emaste.

This is PR32112. Previously when we linked executable with 
--unresolved-symbols=ignore-all and undefined symbols, like:

  _start:
  callq und at PLT

we did not create relocations, though it looks in that case
we should delegate handling of such symbols to runtime linker,
hence should emit them. Patch fixes that.

Also I had to change how --noinhibit-exec works.
According to man it should:
"-noinhibit-exec
Retain the executable output file whenever it is still usable. Normally, the linker will not produce an output file if
it encounters errors during the link process; it exits without writing an output file when it issues any error whatsoever."
But we still failed the link even with this option. I am going to split --noinhibit-exec change to a different patch as it is
independent.


https://reviews.llvm.org/D35724

Files:
  ELF/Config.h
  ELF/Driver.cpp
  ELF/Error.cpp
  ELF/Relocations.cpp
  ELF/Symbols.cpp
  ELF/Symbols.h
  test/ELF/executable-undefined-ignoreall.s
  test/ELF/no-inhibit-exec.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35724.107665.patch
Type: text/x-patch
Size: 5917 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170721/45200e87/attachment.bin>


More information about the llvm-commits mailing list