Commit a4bf3d07 authored by Jim Wilson's avatar Jim Wilson
Browse files

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.
parent 7d7a7d7c
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>
......
......@@ -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);
}
......
2019-01-16 Kito Cheng <kito@andestech.com>
* testsuite/gas/riscv/attribute-empty.d: New.
2019-01-16 Kito Cheng <kito@andestech.com>
Nelson Chu <nelson@andestech.com>
......
#as: -mno-arch-attr
#readelf: -A
#source: empty.s
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment