* [ECOS] ecosSWtools problems
@ 1999-08-10 9:20 Robin Farine
1999-08-11 0:13 ` [ECOS] ecosSWtools problems.2 Robin Farine
1999-08-11 5:58 ` [ECOS] ecosSWtools problems Bart Veer
0 siblings, 2 replies; 3+ messages in thread
From: Robin Farine @ 1999-08-10 9:20 UTC (permalink / raw)
To: ECOS
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]
Hi,
This posting does not concern ecos directly but it may help some ecos
users, so ...
1. When linking code with PC REL24 branches, the ARM bfd linker does not
complain nor modify the branch instruction when the offset overflows,
it just generates code that branch anywhere. The attached patch
should fix this problem.
2. The '--gc-sections' linker flag causes the linker to discard
referenced code. For instance:
class A { public: virtual void f(int) = 0; };
class B : public A { public: void f(int); };
void B::f(int) { ... }
A &a = make_B_instance();
a.f();
In this case, the linker garbage-collects B's vtable entry for 'f()'
and then discard B::f(). The assembler code gcc produces, in
particular '.vtable_inherit #__vt_1B, #0', implies that the linker
will neither propagate the mark of A::f() to B::f(), nor will it use
shared vtable marks.
But when B inherits virtually from A, then gcc generates a
'.vtable_inherit #__vt_1B, #__vt_1A'.
I tried this with the 'ecosSWtools-arm-990321' and with
gcc-2.95. Both result in the same problem.
Now, my questions:
- did I miss something?
- if not then I think that gcc is the culprit since
'.vtable_inherit' does not have anything to do with virtual
inheritance, right?
Thanks,
Robin
--
Robin Farine
ACN Advanced Communications Networks SA Tel: +41 32 724 74 34
Rue du Puits-Godet 8a FAX: +41 32 724 74 54
CH-2000 Neuchâtel e-mail: robin.farine@terminus.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ECOS] ecosSWtools problems.2
1999-08-10 9:20 [ECOS] ecosSWtools problems Robin Farine
@ 1999-08-11 0:13 ` Robin Farine
1999-08-11 5:58 ` [ECOS] ecosSWtools problems Bart Veer
1 sibling, 0 replies; 3+ messages in thread
From: Robin Farine @ 1999-08-11 0:13 UTC (permalink / raw)
To: ECOS
Hi,
Sorry, yesterday I forgot to include the mentioned BFD fix in my posting ...
Robin
----------- cut here --------------
*** ecosSWtools-arm-990321.orig/src/bfd/elf32-arm.h Fri May 7 16:35:05 1999
--- ecosSWtools-arm-990321/src/bfd/elf32-arm.h Sat Aug 7 13:46:00 1999
***************
*** 913,917 ****
+ input_section->output_offset + 8);
value -= offset;
! value = value >> howto->rightshift;
value &= 0xffffff;
--- 913,920 ----
+ input_section->output_offset + 8);
value -= offset;
! value = (bfd_signed_vma)value >> howto->rightshift;
! if ((bfd_signed_vma) value > 0x7fffff ||
! (bfd_signed_vma) value < -0x800000)
! return bfd_reloc_overflow;
value &= 0xffffff;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ECOS] ecosSWtools problems
1999-08-10 9:20 [ECOS] ecosSWtools problems Robin Farine
1999-08-11 0:13 ` [ECOS] ecosSWtools problems.2 Robin Farine
@ 1999-08-11 5:58 ` Bart Veer
1 sibling, 0 replies; 3+ messages in thread
From: Bart Veer @ 1999-08-11 5:58 UTC (permalink / raw)
To: advanc; +Cc: ecos-discuss
>>>>> "Robin" == Robin Farine <advanc@dial.eunet.ch> writes:
Robin> Hi, This posting does not concern ecos directly but it may
Robin> help some ecos users, so ...
Robin> 1. When linking code with PC REL24 branches, the ARM bfd
Robin> linker does not complain nor modify the branch instruction
Robin> when the offset overflows, it just generates code that
Robin> branch anywhere. The attached patch should fix this
Robin> problem.
I passed this on to the gcc team, and the patch has been incorporated
into the master binutils sources (with a few minor changes). I have
also listed the problem and the patch on the known problems list,
http://sourceware.cygnus.com/problemlist.html . Thanks!
Robin> 2. The '--gc-sections' linker flag causes the linker to
Robin> discard referenced code. For instance:
<snip>
Robin> Now, my questions:
Robin> - did I miss something?
Robin> - if not then I think that gcc is the culprit since
Robin> '.vtable_inherit' does not have anything to do with virtual
Robin> inheritance, right?
This one has also been passed on to the gcc team for comments.
Bart Veer // eCos net maintainer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-08-11 5:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-10 9:20 [ECOS] ecosSWtools problems Robin Farine
1999-08-11 0:13 ` [ECOS] ecosSWtools problems.2 Robin Farine
1999-08-11 5:58 ` [ECOS] ecosSWtools problems Bart Veer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).