https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98946

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
No, that is a lld bug, there is no such rule that would say these relocations
can't be applied against non-allocated or debug sections.
GCC var-tracking figures out that the last argument passed to __assert_fail is
equivalent to %ebx + __PRETTY_FUNCTION__.0@gotoff, but can't prove that %ebx
will be equal to __GLOBAL_OFFSET_TABLE__, so can't emit there just
__PRETTY_FUNCTION__.0 - while %ebx must be some __GLOBAL_OFFSET_TABLE__
pointer, it could have been adjusted, so e.g. it could be
__GLOBAL_OFFSET_TABLE__ + index and the needed value would then be
__PRETTY_FUNCTION__.0 + index.
And we want to emit as compact debug info as possible, so emitting it as
%ebx + __PRETTY_FUNCTION__.0@gotoff rather than say (%ebx -
__GLOBAL_OFFSET_TABLE__) + __PRETTY_FUNCTION__.0, especially because
referencing __GLOBAL_OFFSET_TABLE__ symbol in assembly poses interesting
problem (implies special relocations).

Reply via email to