[PATCH] D18190: [ELF] - Error out when R_X86_64_PC32/R_X86_64_32 are used against preemptible symbol when linking shared object.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 02:01:32 PDT 2016


grimar added a comment.

In http://reviews.llvm.org/D18190#375694, @ruiu wrote:

> It's going to print out the warning for each relocation. Isn't it going to be too many?


It's going to error out and stop linking.  For R_X86_64_PC32 and R_X86_64_32 relocations agains preemptible symbols when linking DSO (PIC actually, for -pie it should be the same, but patch about -pie is not yet committed).
That is how execution reaches here from:

  if (Preemptible) {
    // We don't know anything about the finaly symbol. Just ask the dynamic
    // linker to handle the relocation for us.
    Out<ELFT>::RelaDyn->addReloc({Target->getDynRel(Type), &C, RI.r_offset,
                                  false, &Body, getAddend<ELFT>(RI)});
    continue;
  }

I believe we should do that check too. At least as you can see - many of our tests were affected.


http://reviews.llvm.org/D18190





More information about the llvm-commits mailing list