Skip to content

Commit

Permalink
symbolize_test: account for platforms with ".sdata" small data sections
Browse files Browse the repository at this point in the history
A handful of ELF targets use a ".sdata" section for small data.  The
default maximum size of symbols in this section as well as the gcc flag
to change that maximum size differ between two targets.  On such
platforms, if there is no data large enough to exceed the small data
limit then the ".data" section will be excluded entirely.  This changes
the check to ensure that at least one of a ".sdata" section OR a ".data"
section is present.
  • Loading branch information
matoro committed Nov 14, 2023
1 parent 716fa00 commit cc37c61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion absl/debugging/symbolize_test.cc
Expand Up @@ -44,6 +44,7 @@
#define MAP_ANONYMOUS MAP_ANON
#endif

using testing::AnyOf;
using testing::Contains;

#ifdef _WIN32
Expand Down Expand Up @@ -456,7 +457,7 @@ TEST(Symbolize, ForEachSection) {
EXPECT_THAT(sections, Contains(".rodata"));
EXPECT_THAT(sections, Contains(".bss"));
++in_data_section;
EXPECT_THAT(sections, Contains(".data"));
EXPECT_THAT(sections, AnyOf(Contains(".data"), Contains(".sdata")));

close(fd);
}
Expand Down

2 comments on commit cc37c61

@Jamim
Copy link

@Jamim Jamim commented on cc37c61 Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @matoro,

Would you mind submitting a PR with this fix to the upstream?
In case you don't have time to do so, I can do it for you. Just let me know.

Thanks in advance!

@matoro
Copy link
Owner Author

@matoro matoro commented on cc37c61 Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @matoro,

Would you mind submitting a PR with this fix to the upstream? In case you don't have time to do so, I can do it for you. Just let me know.

Thanks in advance!

Hi @Jamim , unfortunately I'm unable to submit any of my fixes to Google projects as I do not have a Google account which is required to sign their CLA nor am I able to obtain one. @thesamesam has proxied some of my PRs before but he's very busy and wasn't able to do this one, so if you could, that would be fantastic.

Please sign in to comment.