+2019-11-21 Alan Modra <amodra@gmail.com>
+
+ PR 273
+ * size.c (sysv_internal_sizer, sysv_internal_printer): Exclude
+ sections with no flag bits set.
+ * testsuite/binutils-all/size.exp: Allow $CODE$ as a text section.
+
2019-11-21 Nick Clifton <nickc@redhat.com>
* objcopy.c (merge_gnu_build_notes): Allow for the possibility
sysv_internal_sizer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
void *ignore ATTRIBUTE_UNUSED)
{
- bfd_size_type size = bfd_section_size (sec);
+ flagword flags = bfd_section_flags (sec);
+ /* Exclude sections with no flags set. This is to omit som spaces. */
+ if (flags == 0)
+ return;
if ( ! bfd_is_abs_section (sec)
&& ! bfd_is_com_section (sec)
&& ! bfd_is_und_section (sec))
{
+ bfd_size_type size = bfd_section_size (sec);
int namelen = strlen (bfd_section_name (sec));
if (namelen > svi_namelen)
sysv_internal_printer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec,
void *ignore ATTRIBUTE_UNUSED)
{
- bfd_size_type size = bfd_section_size (sec);
+ flagword flags = bfd_section_flags (sec);
+ if (flags == 0)
+ return;
if ( ! bfd_is_abs_section (sec)
&& ! bfd_is_com_section (sec)
&& ! bfd_is_und_section (sec))
{
+ bfd_size_type size = bfd_section_size (sec);
+
svi_total += size;
sysv_one_line (bfd_section_name (sec),
set got [binutils_run $SIZE "$SIZEFLAGS -A ${testfile}"]
- set want "${testfile}.*(text|TEXT|P)\[^\n\r\]*\[ \]($dec)\[ \]+$dec.*(\\.data|DATA|D_1)\[^\n\r\]*\[ \]($dec)\[ \]+$dec"
+ set want "${testfile}.*(text|TEXT|\\\$CODE\\\$|P)\[^\n\r\]*\[ \]($dec)\[ \]+$dec.*(\\.data|DATA|D_1)\[^\n\r\]*\[ \]($dec)\[ \]+$dec"
if ![regexp $want $got all textname textsize dataname datasize] then {
fail "size -A"