<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    <div class="moz-cite-prefix">On 21.11.2015 12:31, Rui Ueyama via
      llvm-dev wrote:<br>
    </div>
    <blockquote
cite="mid:CAJENXgtrs-Q4rjMWivmfd+_jqjoAY=mYDfoiUAwZo-+6==nShA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Fri, Nov 20, 2015 at 10:13 PM,
            Simon Atanasyan <span dir="ltr"><<a
                moz-do-not-send="true" href="mailto:simon@atanasyan.com"
                target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:simon@atanasyan.com">simon@atanasyan.com</a></a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
              <br>
              There are more than one MIPS relocations which need GOT
              entry<br>
              creation. Let's consider two of them R_MIPS_GOT16 and
              R_MIPS_CALL16<br>
              [1]. R_MIPS_GOT16 is applicable to local and external
              symbols and<br>
              performs a different calculation in each cases [2].
              R_MIPS_CALL16 is<br>
              applicable to external symbols only and a linker should
              show an error<br>
              if it finds R_MIPS_CALL16 with a local target. Now LLD in
              the<br>
              `InputSectionBase<ELFT>::relocate` methods hides
              original type of GOT<br>
              relocations and always use the result of
              `Target->getGotRefReloc()`<br>
              call. In case of MIPS it is R_MIPS_GOT16. It makes
              impossible to<br>
              perform target symbol type checking and the error
              generation in the<br>
              `MipsTargetInfo<ELFT>::relocateOne` method.<br>
            </blockquote>
            <div><br>
            </div>
            <div>I guess there's no need to hide the type. It's just
              that because it works for x86, x86-64 or aarch64. If mips
              requires more info, it should be ok to change that.</div>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    There was no support for GOT relocations for the AArch64 target. I'm
    adding it with <a class="moz-txt-link-freetext" href="http://reviews.llvm.org/D14917">http://reviews.llvm.org/D14917</a>.<br>
    I faced the similar problem, so I extended the getGotRefReloc()
    method in this patch.<br>
  </body>
</html>