On Mon, 22 May 2023 at 14:28, Gerd Hoffmann <kra...@redhat.com> wrote:
>
>   Hi,
>
> So, after a way to long time gap, I finally found the time to look at
> this again.  This time tried both gcc and clang.
>
> Just dropping the visibility hidden #pragma works fine for gcc.  It also
> works with clang for DEBUG and RELEASE builds, but not for NOOPT builds.
>

So what failures are you seeing in this case? I assume this is using LLD.

So the problem with LLD is that it does not update the static
relocations it emits into the executables, so even if the linker
relaxes any GOT based references, the relocation entry still claims
that a GOT based reference exists.

It should be possible in principle to detect this casein GenFw, but
this would involve decoding the instruction to decide whether it uses
a memory operand or not, and this doesn't seem worth the effort to me.

Recent clang does have a '-fdirect-access-external-data' switch which
should suppress these references, maybe in combination with
-fvisibility=hidden?
(The latter is usually insufficient by itself)


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105122): https://edk2.groups.io/g/devel/message/105122
Mute This Topic: https://groups.io/mt/98257896/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to