mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
subsections: don't lose the offset in the parent section
We don't want to lose the offset into the parent section when we create a subsection, at least not for the MachO backend which is currently the only user of subsections. Allow ofmt->herelabel() to set a flag to copy the section offset from the previous section. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
12810fac92
commit
d644119ded
4 changed files with 26 additions and 8 deletions
|
|
@ -911,9 +911,14 @@ struct ofmt {
|
|||
* The offset isn't passed; and may not be stable at this point.
|
||||
* The subsection number is a field available for use by the
|
||||
* backend. It is initialized to NO_SEG.
|
||||
*
|
||||
* If "copyoffset" is set by the backend then the offset is
|
||||
* copied from the previous segment, otherwise the new segment
|
||||
* is treated as a new segment the normal way.
|
||||
*/
|
||||
int32_t (*herelabel)(const char *name, enum label_type type,
|
||||
int32_t seg, int32_t *subsection);
|
||||
int32_t seg, int32_t *subsection,
|
||||
bool *copyoffset);
|
||||
|
||||
/*
|
||||
* This procedure is called to modify section alignment,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue