[PATCH] D155732: [MC][COFF][AArch64] Avoid incorrect IMAGE_REL_ARM64_BRANCH26 relocations.

Saleem Abdulrasool via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 15:24:47 PDT 2023


compnerd added a comment.

Thinking about this a bit further, I think that it might be better to conform to the Microsoft behaviour here.  If we look at what MASM does, there is no concept of an "assembler temporary" hidden symbols.  We should instead always emit //all// symbols into the symbol table.  The linker is responsible for filtering the symbols that are emitted into the symbol table (only symbols marked for DLL export should be emitted there).  This is one of the fundamental differences between PE and COFF.  COFF will record all symbols (e.g. consider what happens when you build with debug information, all the temporary symbols for lines, etc. are emitted into the object file), PE will emit only the public symbols (technically, it does not have a symbol table at all, only the content needed for the EAT).  This would bring us more in line with the expectations of the platform and the object file format and also avoid the need for any special casing here - we would form the relocation as per usual, the linker will have the necessary context, and then we would simply drop the "temporary" symbol which is not marked for DLL Export.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155732/new/

https://reviews.llvm.org/D155732



More information about the llvm-commits mailing list