pftbest / ldparser Goto Github PK
View Code? Open in Web Editor NEWLinker Script parser
License: MIT License
Linker Script parser
License: MIT License
Hi,
I find this crate very helpful. However, this crate is using a somewhat outdated version of nom
. If you run cargo fix
, you will see a warning:
warning: the following packages contain code that will be rejected by a future version of Rust: nom v3.2.1
Therefore I have managed to upgrade the nom
version used in this crate to 7.1.3, which is the latest version. I have passes all the tests and checked that the parser generates the same output. You can checkout my fork here: https://github.com/VoodooChild99/ldparser/tree/upgrade-nom. I can open a PR if you are interested.
This crate has been incredibly useful for testing linker script fragments. Unfortunately, I seem to have run into some limitations.
Is it possible to INSERT BEFORE/AFTER
functionality, so that I can test for equality against this crate's types instead of strings?
I've successfully used this parser with linkerscript that define constants in hex format, but it will fail with an equivalent 'human-readable' text format.
Additionally the suffixes K and M may be used to scale a constant by respectively. For example, the following all refer to the same quantity:
_fourk_1 = 4K; _fourk_2 = 4096; _fourk_3 = 0x1000;
source: https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC8
For reference, I was specifically using those in the MEMORY section, e.g.:
MEMORY
{
bootloader (rx) : ORIGIN = 0x08000000, LENGTH = 0x020000
FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 0xE0000
}
this will parse successfully
vs
MEMORY
{
bootloader (rx) : ORIGIN = 0x08000000, LENGTH = 128k
FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 1M - 128k
}
which won't
I will post minimum reproducible example later
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.