aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-attrs.c
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2019-01-16 13:37:35 -0800
committerJim Wilson <jimw@sifive.com>2019-01-16 13:37:35 -0800
commita4bf3d0720b1093dd148b7a728f92ce690a8a034 (patch)
treef49a3a49ed0bae1cbdba2605a5805a8d0967474a /bfd/elf-attrs.c
parent7d7a7d7ccf6047cc5b480064e9eb9489542c0dd7 (diff)
downloadgdb-a4bf3d0720b1093dd148b7a728f92ce690a8a034.zip
gdb-a4bf3d0720b1093dd148b7a728f92ce690a8a034.tar.gz
gdb-a4bf3d0720b1093dd148b7a728f92ce690a8a034.tar.bz2
Don't emit vendor attribute section if there is no attribute to emit.
2019-01-16 Kito Cheng <kito@andestech.com> bfd/ * elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even for OBJ_ATTR_PROC. gas/ * testsuite/gas/riscv/attribute-empty.d: New.
Diffstat (limited to 'bfd/elf-attrs.c')
-rw-r--r--bfd/elf-attrs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c
index d238112..bfe135e 100644
--- a/bfd/elf-attrs.c
+++ b/bfd/elf-attrs.c
@@ -106,7 +106,7 @@ vendor_obj_attr_size (bfd *abfd, int vendor)
size += obj_attr_size (list->tag, &list->attr);
/* <size> <vendor_name> NUL 0x1 <size> */
- return ((size || vendor == OBJ_ATTR_PROC)
+ return (size
? size + 10 + strlen (vendor_name)
: 0);
}