[Bug ld/11897] New: Linking of objects with and without attributes sections is incorrect

2010-08-10 Thread mgretton at sourceware dot org
Take the following two test files:

@ test1.s
.syntax unified
.thumb
.global foo
foo:
bx lr
@ end of test1.s

@ test2.s
.syntax unified
.thumb
.cpu cortex-m0

bar:
bl foo
@ end of test2.s

Build as follows:
arm-none-eabi-as test1.s -o test1.o
arm-none-eabi-as test2.s -o test2.o
arm-none-eabi-objcopy -R '.ARM.attributes' test1.o test1.stripped.o
arm-non-ld test1.stripped.o test2.o -o test.axf

ld reports:

.../arm-none-eabi-ld: error: test2.o: Conflicting CPU architectures 0/11

The ABI is silent on the behaviour expected in this case but to ensure backwards
compatibility we should allow such objects to link together.

The basic issue seems to be that we are treating an object with no
.ARM.attributes section as one where all the attributes take their default value
(0 or ) and not one which has all the attributes set to undefined (as if a
TAG_nodefaults attribute was present), and hence compatible with all other 
objects.

-- 
   Summary: Linking of objects with and without attributes sections
is incorrect
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: mgretton at sourceware dot org
CC: bug-binutils at gnu dot org
GCC target triplet: arm-none-eabi


http://sourceware.org/bugzilla/show_bug.cgi?id=11897

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/11897] Linking of objects with and without attributes sections is incorrect

2010-08-10 Thread mgretton at sourceware dot org


-- 
   What|Removed |Added

 AssignedTo|unassigned at sources dot   |mgretton at sourceware dot
   |redhat dot com  |org
 Status|NEW |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=11897

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/11899] New: segments not sorted by LMA

2010-08-10 Thread nickc at redhat dot com
The code in Layout::set_segment_offsets() expects the segments to be sorted by
their load address, but currently they are sorted by the LMA of their first 
section.

To reproduce:
  % cat phdr.s
.text
.word 1

.data
.word 2

  % cat phdrs.ld
PHDRS
{
  headers PT_PHDR FILEHDR PHDRS;
  dataPT_LOAD AT (0xfff5);
  textPT_LOAD AT (0xfff4);
}

SECTIONS
{
  .data 0 :
  {
*(.data)
  } : data

  .text :
  {
*(.text)
  } : text
}

  % gcc -c phdr.s
  % gold -T phdrs.ld phdr.o
  gold: internal error in set_segment_offsets, at gold/layout.cc:2641

-- 
   Summary: segments not sorted by LMA
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P3
 Component: gold
AssignedTo: ian at airs dot com
ReportedBy: nickc at redhat dot com
CC: bug-binutils at gnu dot org
 GCC build triplet: any
  GCC host triplet: any
GCC target triplet: any


http://sourceware.org/bugzilla/show_bug.cgi?id=11899

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/11899] segments not sorted by LMA

2010-08-10 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2010-08-10 11:19 
---
Created an attachment (id=4922)
 -- (http://sourceware.org/bugzilla/attachment.cgi?id=4922action=view)
Sort segments by their load address


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11899

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/11899] segments not sorted by LMA

2010-08-10 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2010-08-10 11:20 
---
Proposed patch uploaded.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11899

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils