send2vinnie / mclinker

Automatically exported from code.google.com/p/mclinker
Other
0 stars 0 forks source link

Add linker script for SECTIONS #154

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The linker script parser currently doesn't support SECTIONS. This is required 
by librump in NetBSD.

Original issue reported on code.google.com by joerg.sonnenberger@googlemail.com on 5 Aug 2013 at 7:11

GoogleCodeExporter commented 9 years ago
The SECTIONS implementation is in ldscript branch. It's not merged back to 
master yet.

Original comment by pete.c...@gmail.com on 6 Aug 2013 at 7:18

GoogleCodeExporter commented 9 years ago
Thanks for the note. For the NetBSD kernel at least, two issues on the branch 
remain to use the original linker script:

(1) Recognize OUTPUT_ARCH. I think for the moment it would be fine to just 
ignore it and/or validate consistency.

(2) KEEP is not supported.

For the RUMP subsystem in userland, unsupported syntax is:

(1) INSERT AFTER .data; for sorting of generated symbols and sections.
(2) *(sectname) syntax for placement, especially in combination with adding 
start/end symbols.

Original comment by joerg.sonnenberger@googlemail.com on 10 Aug 2013 at 12:11

GoogleCodeExporter commented 9 years ago
Hi Joerg,

Peter is preparing to merge ldscript branch into master in recent days.

About (2) KEEP. KEEP is used by --gc-section. I want --gc-section can be a kind 
of optimization pass. Therefore, I prefer to implement --gc-section and KEEP 
after the implementation of pass manager. Diana is writing a proposal of pass 
manager, and welcome to discuss it together.

Original comment by LubaTang on 11 Aug 2013 at 9:45

GoogleCodeExporter commented 9 years ago
Just doing basic syntax checking for KEEP and storing it somewhere would be a 
good enough start.

Original comment by joerg.sonnenberger@googlemail.com on 11 Aug 2013 at 9:39

GoogleCodeExporter commented 9 years ago
I think KEEP syntax is parsed, because we can parse freebsd kernel ldscript.
http://svnweb.freebsd.org/base/head/sys/conf/ldscript.i386?view=markup

Original comment by pete.c...@gmail.com on 12 Aug 2013 at 5:37

GoogleCodeExporter commented 9 years ago
The specific line in NetBSD is:

KEEP(*(.note.netbsd.ident));

I guess this is another case where the *() is not handled?

Original comment by joerg.sonnenberger@googlemail.com on 12 Aug 2013 at 6:42

GoogleCodeExporter commented 9 years ago
This is due to the last semicolon, and the following commit should fix that.

https://code.google.com/p/mclinker/source/detail?r=d95fdae91254b9769e9502a1a5f3d
dae01d86e0e&name=ldscript

Original comment by pete.c...@gmail.com on 13 Aug 2013 at 3:06

GoogleCodeExporter commented 9 years ago

Original comment by pete.c...@gmail.com on 18 Sep 2013 at 11:30