aboutsummaryrefslogtreecommitdiff
path: root/bfd
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
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')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf-attrs.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 529ac73..de44928 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,4 +1,9 @@
2019-01-16 Kito Cheng <kito@andestech.com>
+
+ * elf-attrs.c (vendor_obj_attr_size): Return 0 if size is 0 even
+ for OBJ_ATTR_PROC.
+
+2019-01-16 Kito Cheng <kito@andestech.com>
Nelson Chu <nelson@andestech.com>
* elfnn-riscv.c (in_subsets): New.
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);
}