Browse Source

Handle directive arguments with * in them.

Some of the CFI directives from upstream include expressions such as:

   .cfi_adjust_cfa_offset 32*5+8

(Also the latest version of peg moves the go generate line to
delocate.peg.go.)

Change-Id: I21bdf9ae44f81e4eca7b3565c4581a670f621a80
Reviewed-on: https://boringssl-review.googlesource.com/25624
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 6 years ago
committed by Adam Langley
parent
commit
385e4e9d98
5 changed files with 1374 additions and 1365 deletions
  1. +0
    -2
      util/fipstools/delocate.go
  2. +1
    -1
      util/fipstools/delocate.peg
  3. +1371
    -1362
      util/fipstools/delocate.peg.go
  4. +1
    -0
      util/fipstools/testdata/x86_64-Basic/in.s
  5. +1
    -0
      util/fipstools/testdata/x86_64-Basic/out.s

+ 0
- 2
util/fipstools/delocate.go View File

@@ -12,8 +12,6 @@
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

//go:generate peg delocate.peg

// delocate performs several transformations of textual assembly code. See
// crypto/fipsmodule/FIPS.md for an overview.
package main


+ 1
- 1
util/fipstools/delocate.peg View File

@@ -32,7 +32,7 @@ Directive <- '.' DirectiveName (WS Args)?
DirectiveName <- [[A-Z0-9_]]+
LocationDirective <- (".file" / ".loc") WS [^#\n]+
Args <- Arg ((WS? ',' WS?) Arg)*
Arg <- QuotedArg / [[0-9a-z%+\-_@.]]*
Arg <- QuotedArg / [[0-9a-z%+\-*_@.]]*
QuotedArg <- '"' QuotedText '"'
QuotedText <- (EscapedChar / [^"])*
LabelContainingDirective <- LabelContainingDirectiveName WS SymbolArgs


+ 1371
- 1362
util/fipstools/delocate.peg.go
File diff suppressed because it is too large
View File


+ 1
- 0
util/fipstools/testdata/x86_64-Basic/in.s View File

@@ -13,6 +13,7 @@ foo:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
.cfi_adjust_cfa_offset 32*5+8
movq %rsp, %rbp
movq %rdi, -24(%rbp)
movq -24(%rbp), %rax


+ 1
- 0
util/fipstools/testdata/x86_64-Basic/out.s View File

@@ -16,6 +16,7 @@ foo:
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
.cfi_adjust_cfa_offset 32*5+8
movq %rsp, %rbp
movq %rdi, -24(%rbp)
movq -24(%rbp), %rax


Loading…
Cancel
Save