public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [ld]: Checks for address space overflow will reject any avr program.
@ 2017-03-14 11:01 Georg-Johann Lay
  2017-03-14 11:16 ` Tristan Gingold
  0 siblings, 1 reply; 4+ messages in thread
From: Georg-Johann Lay @ 2017-03-14 11:01 UTC (permalink / raw)
  To: binutils; +Cc: Senthil Kumar Selvaraj, Tristan Gingold

Hi Tristan.

Your addition to ld/ldlang.c::lang_check_section_addresses() leads
to rejection of any program by ld, for example

int x;

int main (void)
{
     return 0;
}

And compiled with

$ avr-gcc-7 main.c -Os -mmcu=atmega8 -save-temps

/INSTALL/bin/../lib/gcc/avr/7.0.1/../../../../avr/bin/ld: section .data 
VMA wraps around address space
/INSTALL/bin/../lib/gcc/avr/7.0.1/../../../../avr/bin/ld: section .bss 
VMA wraps around address space
collect2: error: ld returned 1 exit status

The generated asm is (effectively):

	.file	"main.c"
	.section	.text.startup,"ax",@progbits
.global	main
	.type	main, @function
main:
	ldi r25,0
	ldi r24,0
	ret
	.size	main, .-main
	.comm	x,2,1
	.ident	"GCC: (GNU) 7.0.1 20170314 (experimental) [trunk revision 244001]"


I didn't actually check whether it's due to your change, but as
you are active there, you'll likely know the solution.

avr is using virtual addresses in order to linearize the address
space.


If there is no obvious solution to fix this for avr, it would be
highly appreciated to have a configure option so that respective
portions of ld sources can be deactivated.

If you need more information to reproduce the issue, please let
me know.


Johann


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-15 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 11:01 [ld]: Checks for address space overflow will reject any avr program Georg-Johann Lay
2017-03-14 11:16 ` Tristan Gingold
2017-03-14 11:52   ` Tristan Gingold
2017-03-15 10:24     ` Georg-Johann Lay

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).