ld: add hidden and internal visibility support for XCOFF
authorClément Chigot <clement.chigot@atos.net>
Tue, 23 Nov 2021 14:45:28 +0000 (15:45 +0100)
committerClément Chigot <clement.chigot@atos.net>
Wed, 12 Jan 2022 08:08:25 +0000 (09:08 +0100)
commita8bc481f352d61bb2962e983a1c1c1fdad0230b7
tree0571c01cecab210414116d89f49e005de17a0404
parent59e31fd742a53e8404039e1c4be4ba192672287c
ld: add hidden and internal visibility support for XCOFF

This patch adds a primary support for hidden and internal visibility in
GNU linker for XCOFF format.
The protected visibility isn't yet supported.

PR 22085

bfd/ChangeLog:

* xcofflink.c (xcoff_dynamic_definition_p): Add hidden
  and internal visibility support.
(xcoff_link_add_symbols): Likewise.
(xcoff_auto_export_p): Likewise.
(bfd_xcoff_export_symbol): Likewise.
(xcoff_link_input_bfd): Likewise.

ld/ChangeLog:

* testsuite/ld-vsb/main.c: Adapt for XCOFF.
* testsuite/ld-vsb/sh1.c: Likewse.
* testsuite/ld-vsb/vsb.exp: Likewise.
* testsuite/ld-vsb/visibility-1-xcoff-32.d: New test.
* testsuite/ld-vsb/visibility-1-xcoff-64.d: New test.
* testsuite/ld-vsb/visibility-2-xcoff-32.d: New test.
* testsuite/ld-vsb/visibility-2-xcoff-64.d: New test.
* testsuite/ld-vsb/xcoffvsb.dat: New test.
bfd/xcofflink.c
ld/testsuite/ld-vsb/define.s
ld/testsuite/ld-vsb/main.c
ld/testsuite/ld-vsb/sh1.c
ld/testsuite/ld-vsb/visibility-1-xcoff-32.d [new file with mode: 0644]
ld/testsuite/ld-vsb/visibility-1-xcoff-64.d [new file with mode: 0644]
ld/testsuite/ld-vsb/visibility-2-xcoff-32.d [new file with mode: 0644]
ld/testsuite/ld-vsb/visibility-2-xcoff-64.d [new file with mode: 0644]
ld/testsuite/ld-vsb/vsb.exp
ld/testsuite/ld-vsb/xcoffvsb.dat [new file with mode: 0644]