Landing: baa4e4ddf800

Project / Subsystem

gcc / pe/coff

Date

2026-08-09

Author

Oleg Tolmatcev

Commit

baa4e4ddf800602d818470ef493d3508c4e1e32a

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
pe/coff
patch_id
—
commit_hash
baa4e4ddf800602d818470ef493d3508c4e1e32a
source_type
github
headline
PE/COFF: Implement visibility attribute via .drectve
tldr
PE/COFF targets now support the visibility attribute by emitting directives to the .drectve section, matching Clang's behavior.
author
Oleg Tolmatcev
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • PE/COFF
  • • visibility
  • • linker
  • • MinGW
  • • Cygwin
discussion_id_link
—
bugzilla_pr
—
date
2026-08-09T00:00:00.000Z

GCC’s PE/COFF targets (MinGW, Cygwin) previously ignored the visibility attribute with a warning. This commit implements support for VISIBILITY_HIDDEN and VISIBILITY_INTERNAL by emitting -exclude-symbols directives into the .drectve section. This behavior aligns with Clang and ensures that hidden symbols are correctly excluded from DLL exports, as the GNU linker respects these directives during auto-export processing.