mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
ELF: SHF_MERGE vs SHT_NOBITS
bfd/merge.c puts in quite some effort to track mergable sections. That's all wasted for sections which don't have contents, as for them _bfd_write_merged_section() will never be called. With the combination not having any useful effect, also warn about this in gas.
This commit is contained in:
parent
d5cbf916be
commit
70ab7e0acf
@ -627,6 +627,7 @@ _bfd_add_merge_section (bfd *abfd, void **psinfo, asection *sec,
|
||||
|
||||
if (sec->size == 0
|
||||
|| (sec->flags & SEC_EXCLUDE) != 0
|
||||
|| (sec->flags & SEC_HAS_CONTENTS) == 0
|
||||
|| sec->entsize == 0)
|
||||
return true;
|
||||
|
||||
|
@ -1346,6 +1346,9 @@ obj_elf_section (int push)
|
||||
attr &= ~SHF_MERGE;
|
||||
}
|
||||
|
||||
if ((attr & SHF_MERGE) != 0 && type == SHT_NOBITS)
|
||||
as_warn (_("bogus SHF_MERGE for SHT_NOBITS section"));
|
||||
|
||||
if ((attr & SHF_LINK_ORDER) != 0 && *input_line_pointer == ',')
|
||||
{
|
||||
++input_line_pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user