bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/17288] New: sh64 incremental link does not set flags in ELF head


From: dhowells at redhat dot com
Subject: [Bug ld/17288] New: sh64 incremental link does not set flags in ELF header
Date: Mon, 18 Aug 2014 10:27:36 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=17288

            Bug ID: 17288
           Summary: sh64 incremental link does not set flags in ELF header
           Product: binutils
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: dhowells at redhat dot com

Doing an incremental link with an sh64 binutils does not set the flags field in
the ELF header.  Using this script:

#!/bin/sh -x
CROSS=sh64-linux-gnu-
LDFLAGS="-EL -mshlelf64"
CFLAGS=-m5-64media-nofpu
rm -f hello.o wibble.o foo.o bar.o
echo 'int hello(int i) {return i + 42;}' |
    ${CROSS}gcc $CFLAGS -x c -c - -o hello.o || exit $?
${CROSS}readelf -h hello.o | grep Flags
${CROSS}ar rcsD wibble.o hello.o || exit $?
${CROSS}ld $LDFLAGS -r -o foo.o wibble.o || exit $?
${CROSS}readelf -h foo.o | grep Flags
${CROSS}ld $LDFLAGS -r -o bar.o foo.o || exit $?
${CROSS}readelf -h bar.o | grep Flags

The following is seen:

+ CROSS=sh64-linux-gnu-
+ LDFLAGS='-EL -mshlelf64'
+ CFLAGS=-m5-64media-nofpu
+ rm -f hello.o wibble.o foo.o bar.o
+ echo 'int hello(int i) {return i + 42;}'
+ sh64-linux-gnu-gcc -m5-64media-nofpu -x c -c - -o hello.o
+ sh64-linux-gnu-readelf -h hello.o
+ grep Flags
  Flags:                             0xa, sh5
+ sh64-linux-gnu-ar rcsD wibble.o hello.o
+ sh64-linux-gnu-ld -EL -mshlelf64 -r -o foo.o wibble.o
+ sh64-linux-gnu-readelf -h foo.o
+ grep Flags
  Flags:                             0x0
+ sh64-linux-gnu-ld -EL -mshlelf64 -r -o bar.o foo.o
sh64-linux-gnu-ld: unknown architecture of input file `foo.o' is incompatible
with sh5 output
+ exit 1

As can be seen, the assembler's output is flagged 0xa (sh5), but the linker's
output is flagged 0x0.  Note that adding -belf64-sh64l to the ld command line
doesn't help.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]