[PATCH] D18499: [ELF] - Implemented prototype of location counter support.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 27 07:16:44 PDT 2016
grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
Herald added a subscriber: emaste.
This patch implements my ideas about possible location counter support (very initial now, but few features are already working, output is equal with gold output for testcase and these ideas can be extended I believe). Patch is not ready to submit. It does not contains testcases for errors, probably something else, so it is a demo prototype.
Main testcase I want to show is test/ELF/linkerscript-locationcounter.s, It contains some work with location counter taken from freebsd sample (https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup). It is basic now.
Implemented location counter assignment and ALIGN operations.
Approach is pretty straightforward: each output section now has a list of tokens (expressions list). Later during assigning section addresses this expressions are parsed, Reverse Polish Notation is generated and used to calculate the final VA value for output section.
That should be extremely fast. Complexity of all that operations is O(n) I think.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 28046 bytes
Desc: not available
More information about the llvm-commits