HomePhabricator

Fix broken export table if .rdata is merged with .text.

Description

Fix broken export table if .rdata is merged with .text.

Previously, we assumed that .rdata is zero-filled, so when writing
an COFF import table, we didn't write anything if the data is zero.
That assumption was wrong because .rdata can be merged with .text.
If .rdata is merged with .text, they are initialized with 0xcc which
is a trap instruction.

This patch removes that assumption from code.

Should be merged to 8.0 branch as this is a regression.

Fixes https://bugs.llvm.org/show_bug.cgi?id=39826

Differential Revision: https://reviews.llvm.org/D57168

Details

Committed
ruiuJan 24 2019, 11:02 AM
Differential Revision
D57168: Fix broken export table if .rdata is merged with .text.
Branches
Unknown
Tags
Unknown