aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elf32-arc.c14
2 files changed, 15 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6b5481c..98f0f17 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
+ * elf32-arc.c (arc_elf_merge_attributes): Fix merge attributes.
+
+2018-08-06 Claudiu Zissulescu <claziss@synopsys.com>
+
* elf32-arc.c (arc_elf_merge_attributes): Handle
Tag_ARC_ATR_version.
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index aaa2c3b..25c9666 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -578,7 +578,6 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
bfd_boolean result = TRUE;
const char *sec_name = get_elf_backend_data (ibfd)->obj_attrs_section;
char *tagname = NULL;
- int offset = 0;
/* Skip the linker stubs file. This preserves previous behavior
of accepting unknown attributes in the first input file - but
@@ -732,7 +731,12 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
out_attr[i].i = in_attr[i].i;
break;
+ /* The CPU name is given by the vendor, just choose an
+ existing one if missing or different. There are no fail
+ criteria if they different or both missing. */
case Tag_ARC_CPU_name:
+ if (!out_attr[i].s && in_attr[i].s)
+ out_attr[i].s = _bfd_elf_attr_strdup (obfd, in_attr[i].s);
break;
case Tag_ARC_ABI_rf16:
@@ -764,7 +768,9 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
BFD_ASSERT (in_attr[i].i < 3);
BFD_ASSERT (out_attr[i].i < 3);
- if (out_attr[i].i != 0 && in_attr[i].i != 0
+ if (out_attr[i].i == 0)
+ out_attr[i].i = in_attr[i].i;
+ else if (out_attr[i].i != 0 && in_attr[i].i != 0
&& out_attr[i].i != in_attr[i].i)
{
_bfd_error_handler
@@ -789,7 +795,9 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
if (!tagname)
tagname = "ABI exceptions";
- if (out_attr[i].i != 0 && in_attr[i].i != 0
+ if (out_attr[i].i == 0)
+ out_attr[i].i = in_attr[i].i;
+ else if (out_attr[i].i != 0 && in_attr[i].i != 0
&& out_attr[i].i != in_attr[i].i)
{
_bfd_error_handler