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.
This commit is contained in:
parent
7d7a7d7ccf
commit
a4bf3d0720
@ -1,3 +1,8 @@
|
||||
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);
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
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>
|
||||
|
||||
|
3
gas/testsuite/gas/riscv/attribute-empty.d
Normal file
3
gas/testsuite/gas/riscv/attribute-empty.d
Normal file
@ -0,0 +1,3 @@
|
||||
#as: -mno-arch-attr
|
||||
#readelf: -A
|
||||
#source: empty.s
|
Loading…
Reference in New Issue
Block a user