Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macho_reader.cc lacks support for S_THREAD_LOCAL_ZEROFILL #641

Open
GoogleCodeExporter opened this issue Jul 29, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

Consider this trivial program:

int main(int argc, const char * argv[]) {
    static __thread int var = 0;
    return var;
}

When I compile it and run dump_syms against it, I get the following error:
    the section '__thread_bss' in segment '__DATA' claims its contents lie outside the segment's contents

I debugged through dump_syms to discover that the problematic segment has 
section.flags == 0x12, which is S_THREAD_LOCAL_ZEROFILL. I see that 
macho_reader.cc WalkSegmentSections has support for S_ZEROFILL but not 
S_THREAD_LOCAL_ZEROFILL.

If I make the following obvious change, it solves the problem for me:

Before:
    if ((section.flags & SECTION_TYPE) == S_ZEROFILL) {
After:
    if ((section.flags & SECTION_TYPE) == S_ZEROFILL ||
        (section.flags & SECTION_TYPE) == S_THREAD_LOCAL_ZEROFILL) {


Environment: MacOS X 10.9.5, Xcode 6.1, Breakpad SVN rev 1419

Original issue reported on code.google.com by [email protected] on 26 Feb 2015 at 8:44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant