Discussion:
[uClinux-dev] [PATCH 2/6] recent binutils for h8/300 no longer use prefix
Waldemar Brodkorb
2015-12-30 23:55:44 UTC
Permalink
Remove SYMBOL_PREFIX for h8/300.

Signed-off-by: Waldemar Brodkorb <***@uclibc-ng.org>
Signed-off-by: Yoshinori Sato <***@users.souceforge.jp>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index adf5883..5ca70d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,7 +181,7 @@ fi

SYMBOL_PREFIX=
case $target in
- h8300|bfin*)
+ bfin*)
SYMBOL_PREFIX=_
;;
esac
--
1.7.10.4

_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Waldemar Brodkorb
2015-12-30 23:55:43 UTC
Permalink
Add a check for dlopen to configure.ac

Signed-off-by: Waldemar Brodkorb <***@uclibc-ng.org>
---
configure.ac | 1 +
1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 4e7df5a..adf5883 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,7 @@ dnl redirect some functions to the system symbols, but other local symbols
dnl come from libiberty/libbfd.
dnl int getopt(int, char * const [], const char *) __asm("_" "getopt" "$UNIX2003");
AC_CHECK_LIB(c, malloc, LIBS="-lc $LIBS")
+AC_CHECK_LIB(dl, dlopen)

dnl Checks for header files.
AC_HEADER_STDC
--
1.7.10.4

_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2016-01-04 11:40:25 UTC
Permalink
Hi Waldemar,
Post by Waldemar Brodkorb
Add a check for dlopen to configure.ac
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 4e7df5a..adf5883 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,7 @@ dnl redirect some functions to the system symbols, but other local symbols
dnl come from libiberty/libbfd.
dnl int getopt(int, char * const [], const char *) __asm("_" "getopt" "$UNIX2003");
AC_CHECK_LIB(c, malloc, LIBS="-lc $LIBS")
+AC_CHECK_LIB(dl, dlopen)
Could you successfully compile with just this?

I have to use:

AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")

to get the correct lib ordering at link time. Otherwise the
linking of elf2flt fails for me (testing with m68k).

Regards
Greg

_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Waldemar Brodkorb
2016-01-04 19:00:19 UTC
Permalink
Hi Greg,
Greg Ungerer wrote,
Post by Greg Ungerer
Hi Waldemar,
Post by Waldemar Brodkorb
Add a check for dlopen to configure.ac
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 4e7df5a..adf5883 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,7 @@ dnl redirect some functions to the system symbols, but other local symbols
dnl come from libiberty/libbfd.
dnl int getopt(int, char * const [], const char *) __asm("_" "getopt" "$UNIX2003");
AC_CHECK_LIB(c, malloc, LIBS="-lc $LIBS")
+AC_CHECK_LIB(dl, dlopen)
Could you successfully compile with just this?
Yes. May be it depends on the autoconf/automake used?
Or it depends on binutils version?
I am using binutils 2.25.1. Checked with --enable-plugins on and
off for m68k.
Post by Greg Ungerer
AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")
to get the correct lib ordering at link time. Otherwise the
linking of elf2flt fails for me (testing with m68k).
Should I send an update? So it does fix a case where it fails for
you? I remember buildroot having problems, when LTO and so
--enable-plugins in binutils is used, they just add -ldl:
http://lists.busybox.net/pipermail/buildroot/2015-September/139966.html

best regards
Waldemar
_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2016-01-05 01:58:26 UTC
Permalink
Hi Waldemar,
Post by Waldemar Brodkorb
Greg Ungerer wrote,
Post by Greg Ungerer
Post by Waldemar Brodkorb
Add a check for dlopen to configure.ac
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 4e7df5a..adf5883 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,7 @@ dnl redirect some functions to the system symbols, but other local symbols
dnl come from libiberty/libbfd.
dnl int getopt(int, char * const [], const char *) __asm("_" "getopt" "$UNIX2003");
AC_CHECK_LIB(c, malloc, LIBS="-lc $LIBS")
+AC_CHECK_LIB(dl, dlopen)
Could you successfully compile with just this?
Yes. May be it depends on the autoconf/automake used?
Or it depends on binutils version?
I am using binutils 2.25.1. Checked with --enable-plugins on and
off for m68k.
I am using binutils-2.25.1 also. I used my system autoconf
(which was version 2.69).
Post by Waldemar Brodkorb
Post by Greg Ungerer
AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")
to get the correct lib ordering at link time. Otherwise the
linking of elf2flt fails for me (testing with m68k).
Should I send an update? So it does fix a case where it fails for
you?
Yes. I had to have the -ldl at the end of the link line
of elf2flt for it to successfully link.

If you could generate a new patch that would be good.
Post by Waldemar Brodkorb
I remember buildroot having problems, when LTO and so
http://lists.busybox.net/pipermail/buildroot/2015-September/139966.html
The original check did force -ldl to be added to the libs list
at build time. But it was too early in the args list, it had
to be after the bfd libs to work for me.

Regards
Greg



_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Waldemar Brodkorb
2015-12-30 23:55:45 UTC
Permalink
From: Yoshinori Sato <***@users.souceforge.jp>

Signed-off-by: Yoshinori Sato <***@users.sourceforge.jp>
Signed-off-by: Waldemar Brodkorb <***@uclibc-ng.org>
---
flthdr.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/flthdr.c b/flthdr.c
index 8a8b97c..0401e20 100644
--- a/flthdr.c
+++ b/flthdr.c
@@ -167,8 +167,16 @@ process_file(const char *ifile, const char *ofile)
r = ntohl(relocs[i]);
raddr = flat_get_relocate_addr(r);
printf(" %u\t0x%08lx (0x%08"PRIx32")\t", i, r, raddr);
+#if defined(TARGET_h8300)
+ raddr &= ~0x00000001;
+#endif
fseek_stream(&ifp, sizeof(old_hdr) + raddr, SEEK_SET);
fread_stream(&addr, sizeof(addr), 1, &ifp);
+#if defined(TARGET_h8300)
+ addr = ntohl(addr);
+ if (r & 1)
+ addr &= 0x00ffffff;
+#endif
printf("%"PRIx32"\n", addr);
}
--
1.7.10.4

_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2016-01-04 07:30:24 UTC
Permalink
Hi Waldemar,
Post by Waldemar Brodkorb
---
flthdr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/flthdr.c b/flthdr.c
index 8a8b97c..0401e20 100644
--- a/flthdr.c
+++ b/flthdr.c
@@ -167,8 +167,16 @@ process_file(const char *ifile, const char *ofile)
r = ntohl(relocs[i]);
raddr = flat_get_relocate_addr(r);
printf(" %u\t0x%08lx (0x%08"PRIx32")\t", i, r, raddr);
+#if defined(TARGET_h8300)
+ raddr &= ~0x00000001;
+#endif
fseek_stream(&ifp, sizeof(old_hdr) + raddr, SEEK_SET);
fread_stream(&addr, sizeof(addr), 1, &ifp);
+#if defined(TARGET_h8300)
+ addr = ntohl(addr);
+ if (r & 1)
+ addr &= 0x00ffffff;
+#endif
printf("%"PRIx32"\n", addr);
}
The current flthdr.c code is essentially arch clean at the
moment (no other #ifdef arch special cases). Is this change
really necessary?

Regards
Greg


_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2016-01-07 01:40:40 UTC
Permalink
Hi Yoshinori,
On Mon, 04 Jan 2016 16:30:24 +0900,
Post by Greg Ungerer
Post by Waldemar Brodkorb
---
flthdr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/flthdr.c b/flthdr.c
index 8a8b97c..0401e20 100644
--- a/flthdr.c
+++ b/flthdr.c
@@ -167,8 +167,16 @@ process_file(const char *ifile, const char *ofile)
r = ntohl(relocs[i]);
raddr = flat_get_relocate_addr(r);
printf(" %u\t0x%08lx (0x%08"PRIx32")\t", i, r, raddr);
+#if defined(TARGET_h8300)
+ raddr &= ~0x00000001;
+#endif
fseek_stream(&ifp, sizeof(old_hdr) + raddr, SEEK_SET);
fread_stream(&addr, sizeof(addr), 1, &ifp);
+#if defined(TARGET_h8300)
+ addr = ntohl(addr);
+ if (r & 1)
+ addr &= 0x00ffffff;
+#endif
printf("%"PRIx32"\n", addr);
}
The current flthdr.c code is essentially arch clean at the
moment (no other #ifdef arch special cases). Is this change
really necessary?
Yes. Want fix it.
Current code generate broken relocation information.
So can't load.
I don't follow. What code generates broken relocation information?

The above modified code is only printing out the relocation
information. If whatever code generated it is wrong then
why not fix that?

I can see an argument for better checking - so that bad
relocs don't cause the seeking and printing out of wrong
information. That would be an improvement, and it wouldn't
be architecture dependent.

Regards
Greg
I sent fix of latest master.
Post by Greg Ungerer
Regards
Greg
_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Waldemar Brodkorb
2015-12-30 23:55:46 UTC
Permalink
From: Yoshinori Sato <***@users.souceforge.jp>

Add new relocation R_H8_DISP32A16.
hi-byte clear on R_H8_DIR32 R_H8_DIR24A8 R_H8_DIR24R8 R_H8_DIR32A16 R_H8_DISP32A16

Signed-off-by: Yoshinori Sato <***@users.sourceforge.jp>
Signed-off-by: Waldemar Brodkorb <***@uclibc-ng.org>
---
elf2flt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/elf2flt.c b/elf2flt.c
index 60f5207..17affd9 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -723,6 +723,17 @@ dump_symbols(symbols, number_of_symbols);

flat_reloc_count++;
break;
+#elif defined (TARGET_h8300)
+ case R_H8_DIR32:
+ case R_H8_DIR24A8:
+ case R_H8_DIR24R8:
+ case R_H8_DIR32A16:
+ case R_H8_DISP32A16:
+ r_mem[0] = 0;
+ goto good_32bit_resolved_reloc;
+ case R_H8_PCREL8:
+ case R_H8_PCREL16:
+ continue;
#else
default:
/* The default is to assume that the
@@ -878,6 +889,7 @@ dump_symbols(symbols, number_of_symbols);
break;
case R_H8_DIR32:
case R_H8_DIR32A16: /* currently 32, could be made 16 */
+ case R_H8_DISP32A16:
if (sym_reloc_size != 4) {
printf("R_H8_DIR32 size %d\n", sym_reloc_size);
bad_relocs++;
@@ -889,6 +901,7 @@ dump_symbols(symbols, number_of_symbols);
sym_addr += sym_vma + q->addend;
break;
case R_H8_PCREL16:
+ relocation_needed = 0;
sym_vma = 0;
sym_addr = (*(q->sym_ptr_ptr))->value;
sym_addr += sym_vma + q->addend;
@@ -898,6 +911,7 @@ dump_symbols(symbols, number_of_symbols);
bfd_big_endian(abs_bfd) ? htons(sym_addr) : sym_addr;
continue;
case R_H8_PCREL8:
+ relocation_needed = 0;
sym_vma = 0;
sym_addr = (*(q->sym_ptr_ptr))->value;
sym_addr += sym_vma + q->addend;
--
1.7.10.4

_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2016-01-07 12:42:07 UTC
Permalink
Post by Waldemar Brodkorb
Add new relocation R_H8_DISP32A16.
hi-byte clear on R_H8_DIR32 R_H8_DIR24A8 R_H8_DIR24R8 R_H8_DIR32A16 R_H8_DISP32A16
Applied to elf2flt git tree, thanks.

Regards
Greg
Post by Waldemar Brodkorb
---
elf2flt.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/elf2flt.c b/elf2flt.c
index 60f5207..17affd9 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -723,6 +723,17 @@ dump_symbols(symbols, number_of_symbols);
flat_reloc_count++;
break;
+#elif defined (TARGET_h8300)
+ r_mem[0] = 0;
+ goto good_32bit_resolved_reloc;
+ continue;
#else
/* The default is to assume that the
@@ -878,6 +889,7 @@ dump_symbols(symbols, number_of_symbols);
break;
case R_H8_DIR32A16: /* currently 32, could be made 16 */
if (sym_reloc_size != 4) {
printf("R_H8_DIR32 size %d\n", sym_reloc_size);
bad_relocs++;
@@ -889,6 +901,7 @@ dump_symbols(symbols, number_of_symbols);
sym_addr += sym_vma + q->addend;
break;
+ relocation_needed = 0;
sym_vma = 0;
sym_addr = (*(q->sym_ptr_ptr))->value;
sym_addr += sym_vma + q->addend;
@@ -898,6 +911,7 @@ dump_symbols(symbols, number_of_symbols);
bfd_big_endian(abs_bfd) ? htons(sym_addr) : sym_addr;
continue;
+ relocation_needed = 0;
sym_vma = 0;
sym_addr = (*(q->sym_ptr_ptr))->value;
sym_addr += sym_vma + q->addend;
_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Waldemar Brodkorb
2015-12-30 23:55:47 UTC
Permalink
From: Yoshinori Sato <***@users.souceforge.jp>

R_H8_DIR24A8 / R_H8_DIR24R8 keep all byte.

Signed-off-by: Yoshinori Sato <***@users.sourceforge.jp>
Signed-off-by: Waldemar Brodkorb <***@uclibc-ng.org>
---
elf2flt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elf2flt.c b/elf2flt.c
index 17affd9..6134961 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -725,11 +725,11 @@ dump_symbols(symbols, number_of_symbols);
break;
#elif defined (TARGET_h8300)
case R_H8_DIR32:
- case R_H8_DIR24A8:
- case R_H8_DIR24R8:
case R_H8_DIR32A16:
case R_H8_DISP32A16:
r_mem[0] = 0;
+ case R_H8_DIR24A8:
+ case R_H8_DIR24R8:
goto good_32bit_resolved_reloc;
case R_H8_PCREL8:
case R_H8_PCREL16:
--
1.7.10.4

_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2016-01-07 12:42:29 UTC
Permalink
Post by Waldemar Brodkorb
R_H8_DIR24A8 / R_H8_DIR24R8 keep all byte.
Applied to elf2flt git tree, thanks.

Regards
Greg
Post by Waldemar Brodkorb
---
elf2flt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/elf2flt.c b/elf2flt.c
index 17affd9..6134961 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -725,11 +725,11 @@ dump_symbols(symbols, number_of_symbols);
break;
#elif defined (TARGET_h8300)
r_mem[0] = 0;
goto good_32bit_resolved_reloc;
_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Waldemar Brodkorb
2015-12-30 23:55:48 UTC
Permalink
This is forward ported version of patch from 2006' elf2flt by
Oskar Schirmer <***@emlix.com>.

Signed-off-by: Max Filippov <***@gmail.com>
Signed-off-by: Waldemar Brodkorb <***@uclibc-ng.org>
---
elf2flt.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
elf2flt.ld.in | 7 ++++--
2 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/elf2flt.c b/elf2flt.c
index 6134961..fcd797c 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -6,6 +6,7 @@
* ELF format file handling. Extended relocation support for all of
* text and data.
*
+ * (c) 2008-2009, Xtensa support, Oskar Schirmer <***@emlix.com>
* (c) 2006 Support the -a (use_resolved) option for TARGET_arm.
* Shaun Jackman <***@gmail.com>
* (c) 2004, Nios II support, Wentao Xu <***@microtronix.com>
@@ -57,6 +58,8 @@ const char *elf2flt_progname;
#include <elf/h8.h> /* TARGET_* ELF support for the BFD library */
#elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(TARGET_nios) || defined(TARGET_nios2)
#include "cygwin-elf.h" /* Cygwin uses a local copy */
+#elif defined(TARGET_xtensa)
+#include <elf/xtensa.h> /* TARGET_* ELF support for the BFD library */
#elif defined(TARGET_microblaze)
#include <elf/microblaze.h> /* TARGET_* ELF support for the BFD library */
#elif defined(TARGET_v850)
@@ -110,6 +113,8 @@ const char *elf2flt_progname;
#define ARCH "nios"
#elif defined(TARGET_nios2)
#define ARCH "nios2"
+#elif defined(TARGET_xtensa)
+#define ARCH "xtensa"
#else
#error "Don't know how to support your CPU architecture??"
#endif
@@ -734,6 +739,53 @@ dump_symbols(symbols, number_of_symbols);
case R_H8_PCREL8:
case R_H8_PCREL16:
continue;
+#elif defined(TARGET_xtensa)
+ case R_XTENSA_NONE:
+ case R_XTENSA_OP0:
+ case R_XTENSA_OP1:
+ case R_XTENSA_OP2:
+ case R_XTENSA_SLOT0_OP:
+ case R_XTENSA_SLOT1_OP:
+ case R_XTENSA_SLOT2_OP:
+ case R_XTENSA_SLOT3_OP:
+ case R_XTENSA_SLOT4_OP:
+ case R_XTENSA_SLOT5_OP:
+ case R_XTENSA_SLOT6_OP:
+ case R_XTENSA_SLOT7_OP:
+ case R_XTENSA_SLOT8_OP:
+ case R_XTENSA_SLOT9_OP:
+ case R_XTENSA_SLOT10_OP:
+ case R_XTENSA_SLOT11_OP:
+ case R_XTENSA_SLOT12_OP:
+ case R_XTENSA_SLOT13_OP:
+ case R_XTENSA_SLOT14_OP:
+ case R_XTENSA_SLOT0_ALT:
+ case R_XTENSA_SLOT1_ALT:
+ case R_XTENSA_SLOT2_ALT:
+ case R_XTENSA_SLOT3_ALT:
+ case R_XTENSA_SLOT4_ALT:
+ case R_XTENSA_SLOT5_ALT:
+ case R_XTENSA_SLOT6_ALT:
+ case R_XTENSA_SLOT7_ALT:
+ case R_XTENSA_SLOT8_ALT:
+ case R_XTENSA_SLOT9_ALT:
+ case R_XTENSA_SLOT10_ALT:
+ case R_XTENSA_SLOT11_ALT:
+ case R_XTENSA_SLOT12_ALT:
+ case R_XTENSA_SLOT13_ALT:
+ case R_XTENSA_SLOT14_ALT:
+ case R_XTENSA_ASM_EXPAND:
+ case R_XTENSA_ASM_SIMPLIFY:
+ case R_XTENSA_DIFF8:
+ case R_XTENSA_DIFF16:
+ case R_XTENSA_DIFF32:
+ case R_XTENSA_32_PCREL:
+ continue;
+ case R_XTENSA_32:
+ case R_XTENSA_PLT:
+ goto good_32bit_resolved_reloc;
+ default:
+ goto bad_resolved_reloc;
#else
default:
/* The default is to assume that the
@@ -769,6 +821,23 @@ dump_symbols(symbols, number_of_symbols);
}
} else {
/* Calculate the sym address ourselves. */
+#if defined(TARGET_xtensa)
+ /* For xtensa, calculation of addresses won't
+ work this way. binutils "ld -r" generate
+ different relocation types, among others
+ type 20, R_XTENSA_SLOT0_OP. The latter is
+ produced for various opcodes that differ
+ in size and format, some will have the
+ addend filled in when linking, others won't.
+ For elf2flt to handle these relocations
+ would involve analysing the opcodes in
+ detail. Therefore, elf2flt for xtensa is
+ patched to work with "-a" option solely,
+ which will take output of "ld -q".
+ */
+ printf("ERROR: cannot run without '-a'\n");
+ exit(1);
+#endif
sym_reloc_size = bfd_get_reloc_size(q->howto);

#if !defined(TARGET_h8300) && !defined(TARGET_e1) && !defined(TARGET_bfin) && !defined(TARGET_m68k)
diff --git a/elf2flt.ld.in b/elf2flt.ld.in
index 5353413..bfda0ef 100644
--- a/elf2flt.ld.in
+++ b/elf2flt.ld.in
@@ -16,15 +16,18 @@ SECTIONS {
. = . + 4;
. = ALIGN(0x4) ;
@***@_stext = . ;
- *(.text)
- *(.text.*)
+ *(.literal .text)
+ *(.literal.* .text.*)
*(.gnu.warning)
*(.stub)
+ *(.gnu.linkonce.literal.*)
*(.gnu.linkonce.t*)
*(.glue_7t)
*(.glue_7)
*(.jcr)
+ *(.init.literal)
KEEP (*(.init))
+ *(.fini.literal)
KEEP (*(.fini))

W_RODAT *(.rodata)
--
1.7.10.4

_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Greg Ungerer
2016-01-13 01:21:52 UTC
Permalink
Hi Waldemar,
Post by Waldemar Brodkorb
This is forward ported version of patch from 2006' elf2flt by
Applied to elf2flt git tree, thanks.

Regards
Greg
Post by Waldemar Brodkorb
---
elf2flt.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
elf2flt.ld.in | 7 ++++--
2 files changed, 74 insertions(+), 2 deletions(-)
_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Greg Ungerer
2016-01-07 12:41:42 UTC
Permalink
Post by Waldemar Brodkorb
Remove SYMBOL_PREFIX for h8/300.
Applied to elf2flt git tree, thanks.

Regards
Greg
Post by Waldemar Brodkorb
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index adf5883..5ca70d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,7 +181,7 @@ fi
SYMBOL_PREFIX=
case $target in
- h8300|bfin*)
+ bfin*)
SYMBOL_PREFIX=_
;;
esac
_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev
Loading...