Page MenuHomePhabricator

[lld] treat SHF_MERGE with sh_entsize == 0 as non-mergeable, not fatal error
ClosedPublic

Authored by emaste on Mar 16 2016, 1:19 PM.

Details

Summary

In a FreeBSD/i386 buildworld many objects have SHF_MERGE with sh_entsize == 0. For now just don't merge these.

Diff Detail

Repository
rL LLVM

Event Timeline

emaste updated this revision to Diff 50850.Mar 16 2016, 1:19 PM
emaste retitled this revision from to [lld] treat SHF_MERGE with sh_entsize == 0 as non-mergeable, not fatal error.
emaste updated this object.
emaste added reviewers: ruiu, grimar.
emaste added a subscriber: davide.
ruiu added inline comments.Mar 16 2016, 1:24 PM
ELF/InputFiles.cpp
151–152 ↗(On Diff #50850)

Can we just remove these two lines?

0 % EntSize == 0, so it should naturally fall through the next if statement.

ruiu edited edge metadata.Mar 16 2016, 1:26 PM

LGTM

ELF/InputFiles.cpp
151–152 ↗(On Diff #50850)

Oh, sorry, I was confused. You can't divide by zero.

grimar accepted this revision.Mar 16 2016, 1:30 PM
grimar edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 16 2016, 1:30 PM
This revision was automatically updated to reflect the committed changes.