[PATCH]: new ALIGNTOATLEAST linker script directive

David Stubbs stubbs@IceraSemi.com
Tue Nov 10 17:11:00 GMT 2009


Hey,

This patch adds a new ALIGNTOATLEAST linker script directive. This
simplifies some of our linker scripts, and makes them a lot easier to
read.

I've added a new test, updated the documentation, and checked that there
are no test regressions for i686-pc-linux-gnu.

Here's the extract from the documentation:

---
`ALIGNTOATLEAST(ADDRESS,ALIGN)'
     If the absolute location counter (.) is less than ADDRESS, then
     returns ADDRESS aligned to the next ALIGN boundary.
 

     If the absolute location counter (.) is greater than ADDRESS, then
     returns the absolute location counter (.) aligned to the next
     ALIGN boundary.
 

     Here is an example which aligns the start of the output `.dmem'
     section to at least the address `0x40000000 + 256k', aligned to the
     next `4' byte boundary.
 

          SECTIONS { ...
            .dmem 0x40000000: {
              *(.dmem)
              . = ALIGNTOATLEAST(0x40000000 + 256K, 4);
            }
          ... }
 

---

Is that ok? It's my first attempt at submitting a patch, so I also don't
have write access.

Thanks,
Dave.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aligntoatleast.patch
Type: application/octet-stream
Size: 8441 bytes
Desc: aligntoatleast.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20091110/56d8616d/attachment.obj>


More information about the Binutils mailing list