This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld/emulparams/sparc*.sh NOP missing in all but one file
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 3 Jun 2010 17:07:28 -0500
- Subject: Re: ld/emulparams/sparc*.sh NOP missing in all but one file
- References: <4BFD5BA8.10307@oarcorp.com> <4BFD7379.1020109@oarcorp.com> <20100526.210243.15254143.davem@davemloft.net>
On 05/26/2010 11:02 PM, David Miller wrote:
From: Joel Sherrill<joel.sherrill@oarcorp.com>
Date: Wed, 26 May 2010 14:16:09 -0500
I have modified elf32_sparc.sh to add this line:
NOP=0x01000000
Did you rebuild the 'ld' binary and use that for your tests? The
scripts get transformed into "eelf*_sparc.c" files and then built and
linked into the final linker image.
I am seeing the not-NOPs at the end of a method
where there is padding to get to the start of the next
method.
So this is between two .o's. I have created a
test case which has the two precompiled .o's
and an "undefined.c" precompiled for you.
There is a script c to link them into "t".
sparc-rtems4.10-ld -T linkcmds -o t imfs_chown.o imfs_creat.o und.o
and if you objdump t, you see the problem
at the end of the first method.
I am sure there has to be a good explanation
of what I am doing wrong. All I did was add
NOP=0x01000000 to elf32_sparc.sh, make clean,
configure and install.
The date on the installed ld changed.
Maybe you can spot something.
I'm pretty sure you did this, but I just wanted to make sure :-)
Yes. I am nearly 100% positive but it was good to ask.
Changing elf32_sparc.sh to have the NOP setting and rebuilding 'ld'
works for me here:
-------------------- x.s --------------------
.text
.globl foo
foo:
.align 64
sethi %hi(0x000001), %g1
.align 64
sethi %hi(0x000002), %g2
---------------------------------------------
davem@maramba:~/src/GIT/BINUTILS/build-sparc-linux$ gcc -c -o x.o x.s
davem@maramba:~/src/GIT/BINUTILS/build-sparc-linux$ ./ld/ld-new -r -o y.o x.o
davem@maramba:~/src/GIT/BINUTILS/build-sparc-linux$ objdump --full-contents y.o
y.o: file format elf32-sparc
Contents of section .text:
0000 03000000 01000000 01000000 01000000 ................
0010 01000000 01000000 01000000 01000000 ................
0020 01000000 01000000 01000000 01000000 ................
0030 01000000 01000000 01000000 01000000 ................
0040 05000000 01000000 01000000 01000000 ................
0050 01000000 01000000 01000000 01000000 ................
0060 01000000 01000000 01000000 01000000 ................
0070 01000000 01000000 01000000 01000000 ................
davem@maramba:~/src/GIT/BINUTILS/build-sparc-linux$
--
Joel Sherrill, Ph.D. Director of Research& Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985