[PATCH] D16887: Avoid code duplication when creating dynamic relocations

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 4 12:05:08 PST 2016


On 4 February 2016 at 11:38, George Rimar <grimar at accesssoftek.com> wrote:
> grimar added a subscriber: grimar.
>
> ================
> Comment at: ELF/OutputSections.cpp:249
> @@ +248,3 @@
> +        return Rel.Sym->template getGotPltVA<ELFT>();
> +      }
> +    };
> ----------------
> Don't you need some kind of "unknown reloc type" assert here ?

Will do.

> ================
> Comment at: ELF/OutputSections.h:188
> @@ +187,3 @@
> +  } OKind;
> +
> +  SymbolBody *Sym = nullptr;
> ----------------
> Not all comments have a dot at the end.

Will fix.

> ================
> Comment at: ELF/Writer.cpp:946
> @@ -907,1 +945,3 @@
> +  addRelIpltSymbols();
> +
>    // Scan relocations. This must be done after every symbol is declared so that
> ----------------
> Was that intentionaly moved ?


Yes. addRelIpltSymbols was being called too soon. We would actually
reserve space for dynamic relocations for the symbols it creates. It
was not visible because it only creates symbols when static linking,
so we relocation section was never written out.


More information about the llvm-commits mailing list